Skip to content

Commit 2c14e27

Browse files
committed
chore: add nuget trusted publishing
1 parent 1a5a276 commit 2c14e27

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ jobs:
2929
uses: actions/upload-artifact@v4
3030
with:
3131
name: build-output
32-
path: src/Otel4Vsix/bin/Release/
32+
path: src/CodingWithCalvin.Otel4Vsix/bin/Release/net48
3333
retention-days: 7

.github/workflows/publish.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717

1818
permissions:
1919
contents: write
20+
id-token: write
2021

2122
steps:
2223
- name: Checkout
@@ -57,5 +58,12 @@ jobs:
5758
./nupkg/*.nupkg
5859
./nupkg/*.snupkg
5960
61+
# Get a short-lived NuGet API key
62+
- name: NuGet login (OIDC → temp API key)
63+
uses: NuGet/login@v1
64+
id: login
65+
with:
66+
user: ${{ secrets.NUGET_USERNAME }}
67+
6068
- name: Push to NuGet
61-
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
69+
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)