Skip to content

Commit a3622c8

Browse files
committed
👷 add workflow for publishing to NuGet on version tags
1 parent aad7b4a commit a3622c8

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish to NuGet
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test:
13+
uses: ./.github/workflows/test.yml
14+
secrets: inherit
15+
publish:
16+
needs: test
17+
name: Publish
18+
permissions:
19+
id-token: write
20+
environment: nuget
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Setup .NET
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: '8.0.x'
29+
30+
- name: Restore
31+
run: dotnet restore
32+
33+
- name: Build & Pack
34+
run: dotnet pack QsNet/QsNet.csproj -c Release -o ./artifacts
35+
36+
- name: Push to NuGet
37+
run: dotnet nuget push ./artifacts/*.nupkg \
38+
--api-key ${{ secrets.NUGET_API_KEY }} \
39+
--source https://api.nuget.org/v3/index.json \
40+
--skip-duplicate

0 commit comments

Comments
 (0)