-
Notifications
You must be signed in to change notification settings - Fork 22
89 lines (70 loc) · 2.48 KB
/
release.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: release
on:
push:
tags:
- v*
# https://github.com/adamralph/minver
env:
DOTNET_NOLOGO: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: false
permissions:
contents: read
jobs:
nuget-release:
runs-on: windows-latest
timeout-minutes: 15
env:
CONFIGURATION: Release
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0 # needed so minver finds git tags https://github.com/actions/checkout/issues/172
filter: blob:none # We don't need all blobs
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
restore-keys: |
${{ runner.os }}-nuget
- name: restore
run: dotnet restore
- name: build
run: dotnet build --no-restore
- name: pack
run: dotnet pack -o bin
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: packages
path: bin/*.nupkg
- name: deploy nuget.org
run: find bin -name '*.nupkg' | xargs dotnet nuget push -s $NUGET_SOURCE -k $NUGET_KEY --skip-duplicate --force-english-output
shell: bash
env:
NUGET_SOURCE: https://api.nuget.org/v3/index.json
NUGET_KEY: ${{ secrets.NUGET_API_KEY }}
gh-release:
needs:
- nuget-release
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0 # needed so minver finds git tags https://github.com/actions/checkout/issues/172
filter: blob:none # We don't need all blobs
- name: prepare version
run: echo VERSION=${GITHUB_REF_NAME#v} >> $GITHUB_ENV
- name: Generate changelog with git-cliff
uses: tj-actions/git-cliff@b8b856ab6829a813d4ed58476b6faaec9c2b24ef # v1.4.2
with:
args: --latest --strip all
output: 'CHANGELOG.md'
- uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
with:
bodyFile: 'CHANGELOG.md'
name: ${{ env.VERSION }}
prerelease: ${{ contains(github.ref_name, '-') }}