Skip to content

Commit fbf67c0

Browse files
committed
Add trusted publishing config
1 parent 321f9ea commit fbf67c0

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66
jobs:
77
build:
88
runs-on: ubuntu-latest
9-
permissions: {}
9+
permissions:
10+
id-token: write # enable GitHub OIDC token issuance for this job
1011
timeout-minutes: 15
1112
steps:
1213
- name: Checkout
@@ -27,11 +28,10 @@ jobs:
2728
run: dotnet test --configuration Release /p:Version=${VERSION} --no-build
2829
- name: Pack
2930
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
31+
- name: NuGet login
32+
uses: NuGet/login@v1
33+
id: login
34+
with:
35+
user: ${{ secrets.NUGET_USER }}
3036
- name: Push
31-
run: dotnet nuget push AWise.SepCsvSourceGenerator.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API}
32-
env:
33-
# get a new API key here:
34-
# https://www.nuget.org/account/apikeys
35-
# and put it here:
36-
# https://github.com/AustinWise/SepCsvSourceGenerator/settings/secrets/actions
37-
NUGET_API: ${{ secrets.NUGET_API }}
37+
run: dotnet nuget push AWise.SepCsvSourceGenerator.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.login.outputs.NUGET_API_KEY }}

0 commit comments

Comments
 (0)