Skip to content

Commit e1f4707

Browse files
feat(actions): add nuget trusted publishing (#2299)
1 parent 603cb85 commit e1f4707

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/build-dev.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@ on:
1414

1515
permissions:
1616
contents: read
17+
id-token: write
1718

1819
jobs:
1920
nuget:
2021
runs-on: ubuntu-latest
2122

23+
permissions:
24+
id-token: write
25+
2226
steps:
2327
-
2428
name: Checkout
@@ -31,8 +35,16 @@ jobs:
3135
-
3236
name: Unshallow
3337
run: git fetch --prune --unshallow
38+
39+
-
40+
name: NuGet login
41+
uses: NuGet/login@v1
42+
id: nuget-login
43+
with:
44+
user: ${{ secrets.NUGET_USER }}
45+
3446
-
3547
name: Create and push NuGet package
3648
run: |
3749
dotnet pack -c Release -o nuget -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
38-
dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
50+
dotnet nuget push **/*.nupkg --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)