From 9ac9e7a5d043bc7060a58d6775e7f1c5c4cb507d Mon Sep 17 00:00:00 2001 From: Ikiru Yoshizaki <3856350+guitarrapc@users.noreply.github.com> Date: Wed, 20 May 2026 15:54:28 +0900 Subject: [PATCH 1/4] ci: use OIDC for NuGet package push authentication This updates the build-release workflow to leverage OpenID Connect (OIDC) for authenticating with NuGet.org. The package push operation is now performed directly within the build job, replacing static API key usage with ephemeral credentials for enhanced security. --- .github/workflows/build-release.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index c2a6226..7b17d0f 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -44,6 +44,16 @@ jobs: name: nuget path: ./publish retention-days: 1 + # push nuget + - name: NuGet login (OIDC) + uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0 + id: login + with: + user: ${{ secrets.NUGET_USER }} + - run: dotnet nuget push "./publish/*.nupkg" --skip-duplicate -s https://api.nuget.org/v3/index.json -k "${NUGET_KEY}" + if: ${{ !inputs.dry-run }} + env: + NUGET_KEY: ${{ steps.login.outputs.NUGET_API_KEY }} # release create-release: @@ -56,7 +66,7 @@ jobs: commit-id: ${{ needs.update-packagejson.outputs.sha }} dry-run: ${{ inputs.dry-run }} tag: ${{ inputs.tag }} - nuget-push: true + nuget-push: false secrets: inherit cleanup: From f4387fc07178605e83554fa6533f07a9b72dc97c Mon Sep 17 00:00:00 2001 From: Ikiru Yoshizaki <3856350+guitarrapc@users.noreply.github.com> Date: Wed, 20 May 2026 16:40:27 +0900 Subject: [PATCH 2/4] ci: id-token permission --- .github/workflows/build-release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 7b17d0f..88056fa 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -27,6 +27,7 @@ jobs: needs: [update-packagejson] permissions: contents: read + id-token: write # required for NuGet Trusted Publish runs-on: ubuntu-24.04 timeout-minutes: 10 steps: From 601f92aea1c13a9840372ff5cd2bf1343a30b082 Mon Sep 17 00:00:00 2001 From: Ikiru Yoshizaki <3856350+guitarrapc@users.noreply.github.com> Date: Wed, 20 May 2026 17:48:59 +0900 Subject: [PATCH 3/4] ci: handle SymbolPackageFormat on build --- .github/workflows/build-debug.yaml | 2 +- .github/workflows/build-release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-debug.yaml b/.github/workflows/build-debug.yaml index b0be96e..3a93b9c 100644 --- a/.github/workflows/build-debug.yaml +++ b/.github/workflows/build-debug.yaml @@ -20,4 +20,4 @@ jobs: - uses: Cysharp/Actions/.github/actions/setup-dotnet@main - run: dotnet build -c Release - run: dotnet test -c Release --no-build - - run: dotnet pack -c Release --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -o $GITHUB_WORKSPACE/artifacts + - run: dotnet pack -c Release --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -o $GITHUB_WORKSPACE/artifacts diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 88056fa..b21b740 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -39,7 +39,7 @@ jobs: # pack nuget - run: dotnet build -c Release -p:Version=${{ inputs.tag }} # - run: dotnet test -c Release --no-build - - run: dotnet pack -c Release --no-build -p:Version=${{ inputs.tag }} -o ./publish + - run: dotnet pack -c Release --no-build -p:Version=${{ inputs.tag }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -o ./publish - uses: Cysharp/Actions/.github/actions/upload-artifact@main with: name: nuget From b503cc2827715dc6996de33292b36cafda3282a0 Mon Sep 17 00:00:00 2001 From: Ikiru Yoshizaki <3856350+guitarrapc@users.noreply.github.com> Date: Wed, 20 May 2026 18:19:31 +0900 Subject: [PATCH 4/4] ci: publish symbol files --- .github/workflows/build-release.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index b21b740..7b5de58 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -55,6 +55,10 @@ jobs: if: ${{ !inputs.dry-run }} env: NUGET_KEY: ${{ steps.login.outputs.NUGET_API_KEY }} + - run: dotnet nuget push "./publish/*.snupkg" --skip-duplicate -s https://api.nuget.org/v3/index.json -k "${NUGET_KEY}" + if: ${{ !inputs.dry-run }} + env: + NUGET_KEY: ${{ steps.login.outputs.NUGET_API_KEY }} # release create-release: