Release: v2.0.0 with high-performance Source Generator and Native AOT… #6
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: CD (Publish to NuGet & GitHub Release) | |
| on: | |
| push: | |
| tags: | |
| - 'v[0-9].*' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET SDKs | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x | |
| 10.0.x | |
| - name: Extract Version from Tag | |
| id: get_version | |
| run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build Solution | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Pack NuGet Package | |
| run: dotnet pack src/Refit.Composite/Refit.Composite.csproj --configuration Release /p:PackageVersion=${{ env.VERSION }} --no-build --output ./dist | |
| - name: NuGet login (OIDC → temp API key) | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: HappyEntity | |
| - name: Push to NuGet.org | |
| run: dotnet nuget push ./dist/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| generate_release_notes: true | |
| files: ./dist/*.nupkg |