Skip to content

Commit 654edfb

Browse files
authored
Split publish steps into separate jobs (#33)
1 parent 0e3b7b1 commit 654edfb

1 file changed

Lines changed: 30 additions & 5 deletions

File tree

.github/workflows/publish-nuget.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ jobs:
1212
build:
1313
name: Build Package
1414
runs-on: ubuntu-latest
15-
permissions:
16-
contents: read
17-
packages: write
18-
attestations: write
19-
id-token: write
2015
defaults:
2116
run:
2217
working-directory: ./src
@@ -28,7 +23,37 @@ jobs:
2823
dotnet-version: 10.x.x
2924
- name: Package
3025
run: dotnet pack --configuration Release -p:PackageVersion=${{ github.ref_name }} --output .
26+
- name: Upload package artifact
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: nupkg
30+
path: src/*.nupkg
31+
32+
publish-github:
33+
name: Publish to GitHub packages
34+
needs: build
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: read
38+
packages: write
39+
attestations: write
40+
id-token: write
41+
steps:
42+
- name: Download package artifact
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: nupkg
3146
- name: Publish to GitHub packages
3247
run: dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source ${{ env.PACKAGES_URL }}/${{ github.repository_owner }}/index.json
48+
49+
publish-nuget:
50+
name: Publish to NuGet
51+
needs: build
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Download package artifact
55+
uses: actions/download-artifact@v4
56+
with:
57+
name: nupkg
3358
- name: Publish to NuGet
3459
run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)