Skip to content

Commit 99a93e0

Browse files
committed
ci: use trusted publishing
1 parent 1a336c4 commit 99a93e0

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
jobs:
66
build:
77
runs-on: ubuntu-latest
8+
permissions:
9+
id-token: write
810
steps:
911
- name: Checkout
1012
uses: actions/checkout@v2
@@ -25,10 +27,16 @@ jobs:
2527
run: dotnet test --configuration Release /p:Version=${VERSION} --no-build
2628
- name: Pack
2729
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
30+
31+
- name: NuGet login (OIDC → temp API key)
32+
uses: NuGet/login@v1
33+
id: login
34+
with:
35+
user: ascott18
36+
2837
- name: Push
29-
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_KEY}
30-
env:
31-
NUGET_KEY: ${{ secrets.NUGET_KEY }}
38+
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.login.outputs.NUGET_API_KEY }}
39+
3240
- name: Create GH Release
3341
uses: softprops/action-gh-release@v1
3442
with:

0 commit comments

Comments
 (0)