Skip to content

Commit 0ddb7aa

Browse files
authored
Use NuGet Trusted Publishing (#310)
1 parent 69f9f26 commit 0ddb7aa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ env:
99

1010
jobs:
1111
publish:
12+
permissions:
13+
id-token: write
1214
runs-on: ubuntu-latest
1315
steps:
1416
- uses: actions/checkout@v5
@@ -18,6 +20,12 @@ jobs:
1820
with:
1921
dotnet-version: ${{ env.DOTNET_VERSION }}
2022

23+
- name: NuGet login (OIDC → temp API key)
24+
uses: NuGet/login@v1
25+
id: login
26+
with:
27+
user: shibayan
28+
2129
- name: Setup Version
2230
id: setup_version
2331
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT
@@ -26,4 +34,4 @@ jobs:
2634
run: dotnet pack Sharprompt/Sharprompt.csproj -c Release -o ./dist -p:Version=${{ steps.setup_version.outputs.VERSION }}
2735

2836
- name: Publish
29-
run: dotnet nuget push dist/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
37+
run: dotnet nuget push dist/*.nupkg -k ${{ steps.login.outputs.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)