From afbda9a9064e700975a0f04d2ee2c9005a040ad3 Mon Sep 17 00:00:00 2001 From: Aerafal <126319968+AerafalDev@users.noreply.github.com> Date: Tue, 17 Nov 2026 09:46:18 +0100 Subject: [PATCH] ci: publish to NuGet with Trusted Publishing The long-lived NUGET_API_KEY secret expired, so the v1.8.1 publish was rejected with a 403. The job now asks for a GitHub OIDC token (id-token: write) and trades it with NuGet/login for a short-lived API key, under the nuget.org Trusted Publishing policy for AerafalDev/ShockwaveFlash and publish.yml. No NuGet secret is stored in the repository any more. --- .github/workflows/publish.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d26fb90..af13c48 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,6 +21,9 @@ jobs: publish: name: Pack and push to NuGet runs-on: ubuntu-latest + permissions: + contents: read + id-token: write steps: - name: Checkout @@ -46,10 +49,16 @@ jobs: - name: Pack run: dotnet pack ShockwaveFlash.slnx --no-build --configuration Release --output artifacts + - name: NuGet login + id: nuget-login + uses: NuGet/login@v1 + with: + user: jimmy-mll + - name: Push shell: pwsh env: - NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + NUGET_API_KEY: ${{ steps.nuget-login.outputs.NUGET_API_KEY }} run: | Get-ChildItem artifacts/*.nupkg | ForEach-Object { dotnet nuget push $_.FullName --api-key $env:NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate