-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.21 KB
/
release.yml
File metadata and controls
44 lines (36 loc) · 1.21 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
37
38
39
40
41
42
43
44
name: Release to NuGet
on:
push:
tags:
- '[0-9]*.[0-9]*.[0-9]*'
- '[0-9]*.[0-9]*.[0-9]*-*'
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Pack
run: dotnet pack src/UpDoc/UpDoc.csproj -c Release -o ./artifacts /p:Version=${{ github.ref_name }}
- name: NuGet Trusted Publishing Login
id: nuget-login
uses: nuget/login@v1
with:
user: dean.leigh
- name: Push to NuGet
run: dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }}
- name: Create GitHub Release
run: |
if [[ "${{ github.ref_name }}" == *-* ]]; then
gh release create "${{ github.ref_name }}" --title "v${{ github.ref_name }}" --prerelease --generate-notes
else
gh release create "${{ github.ref_name }}" --title "v${{ github.ref_name }}" --generate-notes
fi
env:
GH_TOKEN: ${{ github.token }}