-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (30 loc) · 1.02 KB
/
release.yml
File metadata and controls
43 lines (30 loc) · 1.02 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
name: Publish to NuGet on Release
on:
release:
types: [published]
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.0.x'
- name: Restore Dependencies
run: dotnet restore
- name: Build Project
run: dotnet build --configuration Release --no-restore
- name: Get Version from Tag
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION#v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Pack NuGet Package
run: dotnet pack --configuration Release --no-build --output ./nupkg -p:Version=${{ env.VERSION }}
- name: Publish to NuGet
run: dotnet nuget push ./nupkg/DuckDuckGoDotNet.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json