-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (30 loc) · 1.01 KB
/
publish-github-packages.yaml
File metadata and controls
36 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Publish NuGet Package to GitHub Packages
on:
push:
branches: ['release']
release:
types: ['published']
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Restore NuGet packages
run: dotnet restore
- name: Build and pack NuGet package
run: dotnet pack --configuration Release
- name: Publish NuGet package to GitHub Packages
env:
PACKAGES_AUTH_TOKEN: ${{ secrets.PACKAGES_AUTH_TOKEN }}
OWNER: jayugg
run: |
dotnet nuget add source --username $OWNER --password $PACKAGES_AUTH_TOKEN --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${OWNER}/index.json"
dotnet nuget push bin/Release/*.nupkg --api-key $PACKAGES_AUTH_TOKEN --source "github" --skip-duplicate