Skip to content

Commit bf1a8cc

Browse files
committed
Publish to NuGet.org
1 parent d622284 commit bf1a8cc

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/build.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,37 @@ jobs:
5050
- name: Push to GitHub Packages
5151
if: github.event_name == 'push' && startsWith(github.repository, 'khellang/')
5252
run: dotnet nuget push ./artifacts/*.*nupkg --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
53+
54+
publish:
55+
runs-on: ubuntu-latest
56+
needs: build
57+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && startsWith(github.repository, 'khellang/')
58+
permissions:
59+
id-token: write
60+
contents: read
61+
62+
env:
63+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
64+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
65+
DOTNET_NOLOGO: true
66+
67+
steps:
68+
- name: Download NuGet package artifact
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: nuget-packages
72+
path: ./artifacts
73+
74+
- name: Setup .NET 10 SDK
75+
uses: actions/setup-dotnet@v4
76+
with:
77+
dotnet-version: "10.x"
78+
79+
- name: Authenticate to NuGet.org with OIDC
80+
uses: NuGet/login@v1
81+
with:
82+
name: nuget.org
83+
service-endpoint: https://api.nuget.org/v3/index.json
84+
85+
- name: Push to NuGet.org
86+
run: dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)