-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (40 loc) · 1.24 KB
/
release.yml
File metadata and controls
45 lines (40 loc) · 1.24 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
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Extract release notes from CHANGELOG
run: |
VERSION="${GITHUB_REF_NAME#v}"
# Extract content between this version heading and the next ## [ heading
awk -v ver="$VERSION" '
/^## \[/ {
if (found) exit
if ($0 ~ "\\[" ver "\\]") { found=1; next }
}
found { print }
' CHANGELOG.md > /tmp/release_notes.md
echo "--- Release notes for v${VERSION} ---"
cat /tmp/release_notes.md
- name: Create GitHub Release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
name: "${{ github.ref_name }}"
tag_name: ${{ github.ref_name }}
body_path: /tmp/release_notes.md
draft: false
prerelease: false
make_latest: "true"
generate_release_notes: false
fail_on_unmatched_files: false