Add [skip publish] support to publish workflow #166
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: Code Validation | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Verify generated code is up-to-date | |
| run: | | |
| dotnet run --project Src/Generate | |
| git diff --exit-code || (echo "Generated code is out of date. Run 'dotnet run --project Src/Generate' and commit the results." && exit 1) | |
| - name: Build | |
| run: dotnet build --no-restore -bl | |
| - name: Pack Solution | |
| run: dotnet pack -p:PackageOutputPath="${GITHUB_WORKSPACE}/packages" -p:IncludeSymbols=false -p:RepositoryCommit=${GITHUB_SHA} -p:PackageVersion="0.0.0.1" | |
| - name: Test | |
| run: dotnet test --framework net8.0 --no-build --verbosity normal | |
| - name: Upload Binary Log | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: binary-log | |
| path: msbuild.binlog | |
| - name: Upload Packages | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: nuget-packages | |
| path: packages/* | |