Skip to content

Commit df1d228

Browse files
committed
feat: publish package to github packages
1 parent 8da71c3 commit df1d228

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/publish-nuget.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
permissions:
1616
contents: read
1717
id-token: write
18+
packages: write
1819

1920
steps:
2021
- name: Checkout
@@ -79,6 +80,23 @@ jobs:
7980
dotnet nuget push $_.FullName --api-key "${{ secrets.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate
8081
}
8182
83+
- name: Configure GitHub Packages source
84+
shell: pwsh
85+
run: |
86+
dotnet nuget remove source github | Out-Null 2>$null
87+
dotnet nuget add source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" `
88+
--name github `
89+
--username "${{ github.actor }}" `
90+
--password "${{ secrets.GITHUB_TOKEN }}" `
91+
--store-password-in-clear-text
92+
93+
- name: Push package to GitHub Packages
94+
shell: pwsh
95+
run: |
96+
Get-ChildItem artifacts -Filter *.nupkg | ForEach-Object {
97+
dotnet nuget push $_.FullName --source github --api-key "${{ secrets.GITHUB_TOKEN }}" --skip-duplicate
98+
}
99+
82100
- name: Upload published artifacts
83101
uses: actions/upload-artifact@v4
84102
with:

0 commit comments

Comments
 (0)