Skip to content

Commit a317f84

Browse files
authored
use trusted publish (#317)
1 parent f30fe91 commit a317f84

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/release.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ env:
1212
jobs:
1313
release:
1414
name: release
15+
permissions:
16+
contents: read
17+
id-token: write # for OIDC token
1518
runs-on: ubuntu-latest
1619
steps:
1720
- uses: actions/checkout@v4
@@ -20,6 +23,12 @@ jobs:
2023
with:
2124
dotnet-version: ${{ env.DOTNET_VERSION }}
2225

26+
- name: NuGet Login
27+
uses: NuGet/login@v1
28+
id: login
29+
with:
30+
user: nenoNaninu
31+
2332
- name: Get version from git tag
2433
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
2534

@@ -41,4 +50,4 @@ jobs:
4150
path: ${{ github.workspace }}/artifacts
4251

4352
- name: dotnet nuget push
44-
run: dotnet nuget push ${{ github.workspace }}/artifacts/*.nupkg --skip-duplicate -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
53+
run: dotnet nuget push ${{ github.workspace }}/artifacts/*.nupkg --skip-duplicate -k ${{ steps.login.outputs.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)