-
Notifications
You must be signed in to change notification settings - Fork 1k
38 lines (31 loc) · 920 Bytes
/
Copy pathpublish.yml
File metadata and controls
38 lines (31 loc) · 920 Bytes
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
37
38
name: Publish
on:
release:
types: [published]
permissions: {}
jobs:
publish:
runs-on: ubuntu-latest
environment: nuget-release
permissions:
contents: read
id-token: write
steps:
- name: Download packages from release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.event.release.tag_name }}
run: gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --pattern '*.nupkg' --dir packages
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'
- name: NuGet login
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}
- name: Publish to NuGet.org
env:
NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}
run: dotnet nuget push packages/*.nupkg --source https://api.nuget.org/v3/index.json