-
Notifications
You must be signed in to change notification settings - Fork 18
58 lines (53 loc) · 1.58 KB
/
release.yml
File metadata and controls
58 lines (53 loc) · 1.58 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Release
permissions:
contents: read
# description: |
# Build a github release on pushed tag.
#
# The only available asset is a release note.
on:
push:
tags:
- v[0-9]+*
jobs:
gh-release:
name: Create release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
-
name: Checkout code
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0
-
name: Extract tag message
id: get_message
# git-cliff may or may not pick the current tag message, difficult to tell when
# this works. We extract the tag message explicitly.
run: |
MESSAGE=$(git tag -l '${{ github.ref_name }}' --format='%(contents:subject)
%(contents:body)
')
export MESSAGE
echo "message<<EOF" >> "${GITHUB_OUTPUT}"
printenv MESSAGE >> "${GITHUB_OUTPUT}"
echo 'EOF' >> "${GITHUB_OUTPUT}"
-
name: Generate release notes
id: notes
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_REPO: ${{ github.repository }}
uses: orhun/git-cliff-action@d77b37db2e3f7398432d34b72a12aa3e2ba87e51 # v4.6.0
with:
config: '.cliff.toml'
args: >-
--current
--with-tag-message '${{ steps.get_message.outputs.message }}'
-
name: Create github release
uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2.4.2
with:
body: ${{ steps.notes.outputs.content }}