-
Notifications
You must be signed in to change notification settings - Fork 97
92 lines (76 loc) · 2.48 KB
/
release.yml
File metadata and controls
92 lines (76 loc) · 2.48 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Release flatpak-builder
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
env:
DEBIAN_FRONTEND: noninteractive
BUILDDIR: builddir
jobs:
release:
name: Build and publish release
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Checkout repository
# 6.0.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y findutils
sudo apt-get install -y \
gcc \
perl \
jq \
$(xargs < .github/dependencies.apt.txt)
- name: Configure flatpak-builder
run: meson setup --wrap-mode nodownload ${BUILDDIR} .
- name: Build flatpak-builder with Meson
run: meson compile -C ${BUILDDIR}
- name: Verify tag matches meson version
run: |
VERSION=$(meson introspect --projectinfo ${BUILDDIR} | jq -r .version)
TAG="${GITHUB_REF_NAME}"
echo "Meson version: $VERSION"
echo "Git tag: $TAG"
if [ "$VERSION" != "$TAG" ]; then
echo "ERROR: Tag does not match meson version"
exit 1
fi
echo "releaseVersion=$VERSION" >> $GITHUB_ENV
- name: Extract changelog from NEWS
run: |
VERSION="${GITHUB_REF_NAME}"
{
echo "releaseChangelog<<EOF"
perl -0777 -ne "print \$1 if /Changes in \Q$VERSION\E\n=+\n\n(.*?)(?=\nChanges in|\Z)/s" NEWS
echo ""
echo "EOF"
} >> $GITHUB_ENV
- name: Determine prerelease
run: |
VERSION="${GITHUB_REF_NAME}"
MINOR=$(echo "$VERSION" | cut -d. -f2)
if [ $((MINOR % 2)) -eq 1 ]; then
echo "preRelease=true" >> $GITHUB_ENV
else
echo "preRelease=false" >> $GITHUB_ENV
fi
- name: Create dist tarball
run: |
meson dist --include-subprojects -C ${BUILDDIR}
ls -lh ${BUILDDIR}/meson-dist/
- name: Create GitHub release
# 1.21.0
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd
with:
tag: ${{ env.releaseVersion }}
name: ${{ env.releaseVersion }}
body: ${{ env.releaseChangelog }}
prerelease: ${{ env.preRelease }}
artifacts: builddir/meson-dist/*
immutableCreate: true