This repository was archived by the owner on Sep 1, 2026. It is now read-only.
Build #1118
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: | |
| # branches: [main] | |
| tags: ['*'] | |
| paths-ignore: | |
| - README.md | |
| - '**/README.md' | |
| - LICENSE | |
| - CHANGELOG.md | |
| - docs/** | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - README.md | |
| - '**/README.md' | |
| - LICENSE | |
| - CHANGELOG.md | |
| - docs/** | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 1 * * *' # daily at 1am UTC | |
| env: | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write # required for nuget/login@v1 to get a temporary NuGet API key via OIDC | |
| jobs: | |
| Build: | |
| runs-on: ubuntu-latest | |
| name: Build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # Required for GitVersion | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v5 | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v4 | |
| - name: Determine Version | |
| uses: gittools/actions/gitversion/execute@v4 | |
| id: gitversion | |
| - name: Install dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: > | |
| dotnet build | |
| --configuration Release | |
| --no-restore | |
| -p:VersionPrefix=${{ steps.gitversion.outputs.fullSemVer }} | |
| - name: Test | |
| run: dotnet test --configuration Release --no-build | |
| - name: Pack | |
| run: > | |
| dotnet pack | |
| --configuration Release | |
| --no-build | |
| --output ${{ github.workspace }}/drop | |
| -p:PackageVersion=${{ steps.gitversion.outputs.fullSemVer }} | |
| # this only exists to ensure we can actually publish AoT sample | |
| - name: Validate AoT | |
| working-directory: '${{ github.workspace}}/samples/AotSample' | |
| run: > | |
| dotnet publish | |
| --configuration Release | |
| --framework net10.0 | |
| --runtime linux-x64 | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| path: ${{ github.workspace }}/drop/* | |
| name: drop | |
| retention-days: 1 | |
| - name: Publish to GitHub Packages | |
| if: ${{ github.actor != 'dependabot[bot]' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')) }} | |
| run: > | |
| dotnet nuget push "${{ github.workspace }}/drop/*" | |
| --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" | |
| --api-key ${{ secrets.GITHUB_TOKEN }} | |
| --skip-duplicate | |
| - name: NuGet login (OIDC → temp API key) | |
| if: ${{ startsWith(github.ref, 'refs/tags') }} | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: 'mburumaxwell' # the user connected via not organization to NuGet.org | |
| - name: Publish to NuGet.org | |
| if: ${{ github.actor != 'dependabot[bot]' && startsWith(github.ref, 'refs/tags') }} | |
| run: > | |
| dotnet nuget push "${{ github.workspace }}/drop/*" | |
| --source "https://api.nuget.org/v3/index.json" | |
| --api-key ${{ steps.login.outputs.NUGET_API_KEY }} | |
| --skip-duplicate |