-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.13 KB
/
release.yml
File metadata and controls
39 lines (34 loc) · 1.13 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
name: Create release
on:
push:
tags: ['v*']
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Extract changelog for this version
id: changelog
run: |
# Extract the changelog section for this version
awk "/^### v${{ steps.version.outputs.version }}/,/^### v[0-9]|^---/{
if (/^### v[0-9]/ && !/v${{ steps.version.outputs.version }}/) exit
if (/^---/) exit
print
}" SPEC.md > /tmp/changelog.md
echo "body<<EOF" >> $GITHUB_OUTPUT
cat /tmp/changelog.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "v${{ steps.version.outputs.version }}" \
--title "AWP Spec v${{ steps.version.outputs.version }}" \
--notes-file /tmp/changelog.md \
SPEC.md