mirror of
https://github.com/Cysharp/UniTask.git
synced 2026-05-20 14:37:17 +00:00
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.
This commit is contained in:
12
.github/workflows/build-release.yaml
vendored
12
.github/workflows/build-release.yaml
vendored
@@ -45,6 +45,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 }}
|
||||
|
||||
build-unity:
|
||||
needs: [update-packagejson]
|
||||
@@ -107,7 +117,7 @@ jobs:
|
||||
commit-id: ${{ needs.update-packagejson.outputs.sha }}
|
||||
dry-run: ${{ inputs.dry-run }}
|
||||
tag: ${{ inputs.tag }}
|
||||
nuget-push: true
|
||||
nuget-push: false
|
||||
release-upload: true
|
||||
release-asset-path: ./UniTask.${{ inputs.tag }}.unitypackage/UniTask.${{ inputs.tag }}.unitypackage
|
||||
secrets: inherit
|
||||
|
||||
Reference in New Issue
Block a user