-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (28 loc) · 804 Bytes
/
Copy pathrelease.yml
File metadata and controls
34 lines (28 loc) · 804 Bytes
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
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract changelog section for this tag
run: |
TAG_NAME="${GITHUB_REF_NAME}"
awk -v tag="$TAG_NAME" '
$0 ~ "^## "tag"([^0-9a-zA-Z].*)?$" { found=1; print; next }
found && /^## / { exit }
found { print }
' CHANGELOG.md > release_notes.md
if [ ! -s release_notes.md ]; then
echo "No matching section found in CHANGELOG.md for $TAG_NAME" > release_notes.md
fi
- name: Create Release
uses: softprops/action-gh-release@v2
with:
body_path: release_notes.md