chore(main): release 2.1.5 #431
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: CI/CD Pipeline | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| paths-ignore: | |
| - "docs/**" | |
| - "**.md" | |
| - ".github/ISSUE_TEMPLATE/**" | |
| - ".claude/**" | |
| release: | |
| types: [ published ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore | |
| run: dotnet restore --locked-mode | |
| - name: Check formatting | |
| run: | | |
| dotnet tool restore | |
| dotnet csharpier check . | |
| - name: Test | |
| run: dotnet test --configuration Release --verbosity normal --no-restore | |
| publish: | |
| if: github.event_name == 'release' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC token for NuGet trusted publishing | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore | |
| run: dotnet restore --locked-mode | |
| - name: Build and Pack | |
| run: dotnet pack JsonApiToolkit/JsonApiToolkit.csproj -c Release --no-restore | |
| # Exchange OIDC token for a short-lived NuGet API key | |
| - name: NuGet login | |
| id: login | |
| uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0 | |
| with: | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Publish to NuGet.org | |
| run: dotnet nuget push "JsonApiToolkit/bin/Release/*.nupkg" | |
| --source https://api.nuget.org/v3/index.json | |
| --api-key ${{ steps.login.outputs.NUGET_API_KEY }} | |
| --skip-duplicate |