Skip to content

Commit 8000ead

Browse files
authored
add release action (#1868)
1 parent 83b82ec commit 8000ead

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
create-release:
9+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'Release')
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Get version from meson.build
19+
id: version
20+
run: |
21+
VERSION=$(grep -Po "version:\s*'\K[0-9.]+(?=')" meson.build)
22+
echo "version=$VERSION" >> $GITHUB_OUTPUT
23+
24+
- name: Extract changelog from appdata
25+
id: changelog
26+
run: |
27+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
28+
xmlstarlet sel -t -m "/component/releases/release[@version='${{ steps.version.outputs.version }}']/description" -c . data/io.github.alainm23.planify.appdata.xml.in.in | sed 's/<[^>]*>//g' >> $GITHUB_OUTPUT
29+
echo "EOF" >> $GITHUB_OUTPUT
30+
31+
- name: Create GitHub Release
32+
uses: softprops/action-gh-release@v2
33+
with:
34+
tag_name: v${{ steps.version.outputs.version }}
35+
name: Planify ${{ steps.version.outputs.version }}
36+
body: |
37+
${{ steps.changelog.outputs.changelog }}
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)