Skip to content

Commit

Permalink
Merge pull request #262 from Gigas002/net8.0_migration
Browse files Browse the repository at this point in the history
Net8.0 migration
  • Loading branch information
Gigas002 authored Dec 2, 2023
2 parents eff74b3 + be51226 commit 34e22d7
Show file tree
Hide file tree
Showing 67 changed files with 1,472 additions and 1,013 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
**/bin/
**/obj/
**/obj/
**/artifacts/
**/publish/
4 changes: 0 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
Expand All @@ -11,7 +10,6 @@
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
Expand All @@ -34,7 +32,6 @@
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
Expand All @@ -43,7 +40,6 @@
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
Expand Down
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: Gigas002 # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
21 changes: 21 additions & 0 deletions .github/actions/push-nupkg/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Push nupkg'
description: 'Pushes nuget package to feed'
inputs:
publish-base:
description: 'Directory with publish artifacts (nupkgs/snupkgs)'
api-key:
description: 'API key'
package-feed:
description: 'Package feed'

runs:
using: "composite"
steps:
- id: dotnet-nuget-push
run: |
foreach($file in (Get-ChildItem "${{inputs.publish-base}}/" -Recurse -Include *.nupkg))
{
dotnet nuget push $file -k "${{inputs.api-key}}" -s "${{inputs.package-feed}}" --skip-duplicate
}
shell: pwsh
58 changes: 58 additions & 0 deletions .github/actions/read-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# refer to read_version.ps1 for standalone script

name: 'Read version'
description: 'Reads version prefix and suffix'
inputs:
build-props-path:
description: 'Path to Directory.Build.props file'
required: false
type: string
default: 'Directory.Build.props'
continious-tag:
description: 'Tag for conrinious docker builds'
required: false
type: string
default: 'latest'
outputs:
prefix:
description: 'Version prefix'
value: ${{steps.version.outputs.prefix}}
suffix:
description: 'Version suffix'
value: ${{steps.version.outputs.suffix}}
build:
description: 'Build number, taken from AssemblyVersion'
value: ${{steps.version.outputs.build}}
docker-tag:
description: 'Latest for ci, vprefix for release'
value: ${{steps.version.outputs.docker-tag}}

runs:
using: "composite"
steps:
- id: version
run: |
$path = "${{inputs.build-props-path}}"
Set-Variable VersionPrefixPath -Option ReadOnly -Value "/Project/PropertyGroup/VersionPrefix"
Set-Variable VersionSuffixPath -Option ReadOnly -Value "/Project/PropertyGroup/VersionSuffix"
Set-Variable AssemblyVersionPath -Option ReadOnly -Value "/Project/PropertyGroup/AssemblyVersion"
$versionPrefix = (Select-Xml -Path "$path" -XPath $VersionPrefixPath).Node.InnerText
$versionSuffix = (Select-Xml -Path "$path" -XPath $VersionSuffixPath).Node.InnerText
$assemblyVersion = (Select-Xml -Path "$path" -XPath $AssemblyVersionPath).Node.InnerText
$buildVersion = $assemblyVersion.Split('.')[-1]
$dockerTag = ""
if ("$versionSuffix") {
$dockerTag = "${{inputs.continious-tag}}"
}
else {
$dockerTag = "v$versionPrefix"
}
Write-Output "prefix=$versionPrefix" >> $env:GITHUB_OUTPUT
Write-Output "suffix=$versionSuffix" >> $env:GITHUB_OUTPUT
Write-Output "build=$buildVersion" >> $env:GITHUB_OUTPUT
Write-Output "docker-tag=$dockerTag" >> $env:GITHUB_OUTPUT
shell: pwsh
9 changes: 3 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
interval: "daily"

- package-ecosystem: nuget
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: daily
time: "22:00"
open-pull-requests-limit: 10

interval: "daily"
245 changes: 245 additions & 0 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
name: build-test-deploy

on: [push, pull_request]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: false

jobs:

# no point in matrix without deploy tasks
# see discussion: https://github.com/orgs/community/discussions/42335

# build-test:
# strategy:
# matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
# uses: ./.github/workflows/build-test.yml
# with:
# runs-on: ${{ matrix.os }}

# passing env to jobs
# see: https://github.com/orgs/community/discussions/26671

# building tasks

build-windows:
uses: ./.github/workflows/build.yml
with:
runs-on: windows-latest
dotnet-version: '8.x'

build-linux:
uses: ./.github/workflows/build.yml
with:
runs-on: ubuntu-latest
dotnet-version: '8.x'

build-macos:
uses: ./.github/workflows/build.yml
with:
runs-on: macos-latest
dotnet-version: '8.x'

# testing tasks

test-windows:
needs: build-windows
uses: ./.github/workflows/test.yml
with:
runs-on: windows-latest
projects: '["GTiff2Tiles.Tests/GTiff2Tiles.Tests.csproj"]'
dotnet-version: '8.x'
secrets: inherit

test-linux:
needs: build-linux
uses: ./.github/workflows/test.yml
with:
projects: '["GTiff2Tiles.Tests/GTiff2Tiles.Tests.csproj"]'
runs-on: ubuntu-latest
dotnet-version: '8.x'
secrets: inherit

test-macos:
needs: build-macos
uses: ./.github/workflows/test.yml
with:
projects: '["GTiff2Tiles.Tests/GTiff2Tiles.Tests.csproj"]'
runs-on: macos-latest
dotnet-version: '8.x'
secrets: inherit

# deploy binaries

deploy-binaries-windows:
needs: test-windows
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/deploy-binaries.yml
with:
runs-on: windows-latest
projects: '["GTiff2Tiles.Console/GTiff2Tiles.Console.csproj", "GTiff2Tiles.Avalonia/GTiff2Tiles.Avalonia.csproj"]'
publish-base: 'publish'
continious-tag: 'continious'
dotnet-version: '8.x'
build-props-path: 'Directory.Build.props'
secrets: inherit

deploy-binaries-linux:
needs: test-linux
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/deploy-binaries.yml
with:
runs-on: ubuntu-latest
projects: '["GTiff2Tiles.Console/GTiff2Tiles.Console.csproj", "GTiff2Tiles.Avalonia/GTiff2Tiles.Avalonia.csproj"]'
publish-base: 'publish'
continious-tag: 'continious'
dotnet-version: '8.x'
build-props-path: 'Directory.Build.props'
secrets: inherit

deploy-binaries-macos:
needs: test-macos
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/deploy-binaries.yml
with:
runs-on: macos-latest
projects: '["GTiff2Tiles.Console/GTiff2Tiles.Console.csproj", "GTiff2Tiles.Avalonia/GTiff2Tiles.Avalonia.csproj"]'
publish-base: 'publish'
continious-tag: 'continious'
dotnet-version: '8.x'
build-props-path: 'Directory.Build.props'
secrets: inherit

# deploy pages

deploy-pages-linux:
needs: test-linux
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/deploy-pages.yml
with:
runs-on: ubuntu-latest
dotnet-version: '8.x'
docfx-json-path: 'docfx.json'
publish-dir: 'docs'
secrets: inherit

# deploy src

deploy-src-linux:
needs: test-linux
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/deploy-src.yml
with:
runs-on: ubuntu-latest
publish-base: 'publish'
continious-tag: 'continious'
build-props-path: 'Directory.Build.props'
secrets: inherit

# deploy peckages

deploy-packages-nuget-linux:
needs: test-linux
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/deploy-packages.yml
with:
runs-on: ubuntu-latest
packages: '["GTiff2Tiles.Core/GTiff2Tiles.Core.csproj"]'
publish-base: 'publish'
package-feed: "https://api.nuget.org/v3/index.json"
dotnet-version: '8.x'
build-props-path: 'Directory.Build.props'
secrets:
TOKEN: ${{secrets.NUGET_API_KEY}}

deploy-packages-github-linux:
needs: test-linux
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/deploy-packages.yml
with:
runs-on: ubuntu-latest
packages: '["GTiff2Tiles.Core/GTiff2Tiles.Core.csproj"]'
publish-base: 'publish'
package-feed: "https://nuget.pkg.github.com/${{github.repository_owner}}/index.json"
dotnet-version: '8.x'
build-props-path: 'Directory.Build.props'
secrets:
TOKEN: ${{secrets.GITHUB_TOKEN}}

# deploy docker

deploy-docker-docker-hub-linux:
needs: test-linux
if: github.ref == 'refs/heads/master'
strategy:
matrix:
project: ["gtiff2tiles-console---Dockerfile"]
uses: ./.github/workflows/deploy-docker.yml
with:
runs-on: ubuntu-latest
registry: 'docker.io'
project: ${{matrix.project}}
build-props-path: 'Directory.Build.props'
continious-tag: 'latest'
username: gigas002
secrets:
TOKEN: ${{secrets.DOCKER_HUB_TOKEN}}

deploy-docker-github-linux:
needs: test-linux
if: github.ref == 'refs/heads/master'
strategy:
matrix:
project: ["gtiff2tiles-console---Dockerfile"]
uses: ./.github/workflows/deploy-docker.yml
with:
runs-on: ubuntu-latest
registry: 'ghcr.io'
project: ${{matrix.project}}
build-props-path: 'Directory.Build.props'
continious-tag: 'latest'
username: ${{github.repository_owner}}
secrets:
TOKEN: ${{secrets.GITHUB_TOKEN}}

# snyk security report

snyk-check-code-linux:
uses: ./.github/workflows/snyk-check-code.yml
if: github.ref == 'refs/heads/master'
with:
runs-on: ubuntu-latest
dotnet-version: '8.x'
secrets: inherit

# snyk docker images checks

snyk-check-docker-docker-hub-linux:
needs: deploy-docker-docker-hub-linux
if: github.ref == 'refs/heads/master'
strategy:
matrix:
project: ["gtiff2tiles-console---Dockerfile"]
uses: ./.github/workflows/snyk-check-docker.yml
with:
runs-on: ubuntu-latest
registry: 'docker.io'
project: ${{matrix.project}}
username: gigas002
secrets: inherit

snyk-check-docker-github-linux:
needs: deploy-docker-github-linux
if: github.ref == 'refs/heads/master'
strategy:
matrix:
project: ["gtiff2tiles-console---Dockerfile"]
uses: ./.github/workflows/snyk-check-docker.yml
with:
runs-on: ubuntu-latest
registry: 'ghcr.io'
project: ${{matrix.project}}
username: gigas002
secrets: inherit
Loading

0 comments on commit 34e22d7

Please sign in to comment.