Refactor to CSharp 13.0 #91
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: .NET Core | |
| on: | |
| push: | |
| branches: [main, "dev*", "dev/*"] | |
| tags: ["*.*.*"] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| #runs-on: [macos-latest, ubuntu-22.04, windows-latest] | |
| runs-on: [ubuntu-22.04, windows-latest] | |
| name: ${{ matrix.runs-on }} | |
| runs-on: ${{ matrix.runs-on }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET Core 9.0.x, 8.0.x and 6.0.x | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 6.0.x | |
| 8.0.x | |
| 9.0.x | |
| - name: dotnet info | |
| run: dotnet --info | |
| - name: Install dependencies | |
| run: dotnet restore --verbosity normal | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore --verbosity normal | |
| - name: Test | |
| run: dotnet test -c Release --no-build --verbosity normal | |
| - name: Pack | |
| run: dotnet pack -c Release -o ./artifacts/packages/ --no-build --verbosity normal | |
| - name: Upload artifacts | |
| if: ${{ success() && runner.os == 'Windows' && github.event_name == 'push' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: DotnetAppSettings | |
| path: artifacts/packages | |
| - if: ${{ success() && runner.os == 'Windows' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }} | |
| name: Push MyGet | |
| run: dotnet nuget push .\artifacts\packages\*.nupkg -s https://www.myget.org/F/netlah/api/v2/package -k ${{ secrets.MYGET }} | |
| - if: ${{ success() && runner.os == 'Windows' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }} | |
| name: Publish Nuget to GitHub registry | |
| run: dotnet nuget push .\artifacts\packages\*.nupkg -s https://nuget.pkg.github.com/NetLah/index.json --skip-duplicate -k ${{ secrets.PUSH_GITHUB_REGISTRY_TOKEN }} |