Apply suggestions from code review #4
Workflow file for this run
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: Build | |
| on: | |
| push: | |
| pull_request: | |
| release: | |
| types: | |
| - published | |
| env: | |
| # Stop wasting time caching packages | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
| # Disable sending usage data to Microsoft | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| # GitHub Packages Feed settings | |
| GITHUB_FEED: https://nuget.pkg.github.com/autoguru-au/ | |
| GITHUB_USER: autoguru-au | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| global-json-file: global.json | |
| - name: Install dependencies | |
| run: dotnet restore EntityFrameworkCore.Triggered.sln -p:Configuration=Release | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore EntityFrameworkCore.Triggered.sln | |
| - name: Test | |
| run: dotnet test --configuration Release --verbosity normal EntityFrameworkCore.Triggered.sln | |
| - name: Pack | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| dotnet pack -v normal --configuration Release --include-symbols --include-source -p:PackageVersion=3-pre-$GITHUB_RUN_ID -o nupkg EntityFrameworkCore.Triggered.Core.slnf | |
| - name: Upload Artifact | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nupkg | |
| path: ./nupkg/*.nupkg | |
| build-samples: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| global-json-file: global.json | |
| - name: Install dependencies | |
| run: dotnet restore EntityFrameworkCore.Triggered.Samples.slnf | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore EntityFrameworkCore.Triggered.Samples.slnf | |
| prerelease: | |
| needs: build | |
| if: github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nupkg | |
| - name: Push to GitHub Feed | |
| run: | | |
| for f in ./nupkg/*.nupkg | |
| do | |
| dotnet nuget push $f --source $GITHUB_FEED --api-key ${{github.token}} --skip-duplicate --no-symbols | |
| done |