Repository navigation
108 lines (98 loc) · 3.9 KB
/
Copy pathrelease.yml
File metadata and controls
108 lines (98 loc) · 3.9 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Create Release
on:
push:
tags:
- 'v*'
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Release Notes
id: release_notes
run: |
# Extract the section for the pushed tag (up to but excluding
# the next version heading) from the root CHANGELOG.md, or
# fall back to git log. An awk exact-match is used on purpose:
# a sed range with one pattern restarts after it ends and
# prints every version section instead of just this one.
TAG="${GITHUB_REF_NAME}"
rm -f release_notes.md release_notes.tmp
if [ -f CHANGELOG.md ]; then
awk -v tag="$TAG" '
/^## / {
if (found) exit
br = "## [" tag "]"
pl = "## " tag
if ($0 == br || index($0, br " ") == 1) { found = 1; print; next }
if ($0 == pl || index($0, pl " ") == 1 || index($0, pl "-") == 1) { found = 1; print; next }
next
}
found { print }
' CHANGELOG.md > release_notes.md
# Never publish link-reference footer lines (e.g. "[v3.0.1]: https://...").
grep -vE '^\[[^]]+\]:[[:space:]]*https?://' release_notes.md > release_notes.tmp || true
mv release_notes.tmp release_notes.md
fi
if [ ! -s release_notes.md ]; then
git log --oneline -n 10 | grep -vE '^\[[^]]+\]:[[:space:]]*https?://' > release_notes.md || true
fi
# Append a compare link from the previous tag; omit it when
# there is no previous tag instead of emitting a broken link.
if PREV_TAG=$(git describe --tags --abbrev=0 "${TAG}^" 2>/dev/null) && [ -n "${PREV_TAG}" ]; then
{
echo ""
echo "**Full changelog**: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/compare/${PREV_TAG}...${TAG}"
} >> release_notes.md
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: release_notes.md
draft: false
prerelease: false
generate_release_notes: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The releases used to carry only source archives: build.sh existed and
# worked locally, but nothing published its output, so "download the
# AppImage" in the README pointed at a file that was never there. This
# job runs the documented build and attaches the result to the release
# the job above created.
appimage:
name: Build and attach AppImage
needs: release
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
# build.sh source-builds dbus-python, PyGObject and pycairo against
# the bundled interpreter, so it needs their build-time headers. The
# list lives in tools/appimage/install-build-deps.sh rather than
# here: a second copy of it is what let a tag push discover a missing
# dependency (see that script's header).
- name: Install build dependencies
run: bash tools/appimage/install-build-deps.sh
- name: Build the AppImage
run: ./tools/appimage/build.sh
- name: Verify the artifact exists
run: |
test -s build/appimage/dist/LinuxTask-x86_64.AppImage
ls -l build/appimage/dist/LinuxTask-x86_64.AppImage
- name: Attach the AppImage to the release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: build/appimage/dist/LinuxTask-x86_64.AppImage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}