Publish to NuGet #12
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: Publish to NuGet | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| name: Build, Pack, and Publish | |
| runs-on: windows-2022 | |
| permissions: | |
| id-token: write # enable GitHub OIDC token issuance for this job | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build solution | |
| run: dotnet build ./Alfa1.TokenStorage.sln -c Release | |
| - name: Pack projects | |
| run: dotnet pack ./Alfa1.TokenStorage.sln -c Release --no-build -o ./packages | |
| - name: NuGet login (OIDC → temp API key) | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Push to NuGet | |
| run: dotnet nuget push "**/packages/Alfa1.TokenStorage.*.nupkg" --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source "https://api.nuget.org/v3/index.json" --skip-duplicate |