Skip to content

Commit 02f65f1

Browse files
Add environment and update NuGet push step
1 parent 61e5471 commit 02f65f1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/publish-postgresql-package.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
build-and-publish:
1010
runs-on: ubuntu-latest
11+
environment: production
1112
permissions:
1213
contents: read
1314

@@ -32,8 +33,12 @@ jobs:
3233

3334
- name: Pack
3435
run: dotnet pack src/BbQ.Events.PostgreSql/BbQ.Events.PostgreSql.csproj --configuration Release --no-build --output ./artifacts
35-
36+
37+
- name: NuGet login (OIDC → temp API key)
38+
uses: NuGet/login@v1
39+
id: login
40+
with:
41+
user: ${{ secrets.NUGET_USER }}
42+
3643
- name: Push to NuGet
37-
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
38-
env:
39-
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
44+
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)