-
Notifications
You must be signed in to change notification settings - Fork 0
318 lines (300 loc) · 10.9 KB
/
Copy pathpackages.yml
File metadata and controls
318 lines (300 loc) · 10.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
name: Packages
# Builds all five Linux formats. Native packages and AppImage get headless
# install checks. A matching version tag publishes them after CI succeeds.
on:
push:
tags: ['v*']
pull_request:
paths:
- 'packaging/**'
- '.github/workflows/packages.yml'
- '.github/workflows/ci.yml'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: packages-${{ github.ref }}
cancel-in-progress: false
jobs:
prepare:
name: Validate release version
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Check version before building packages
id: version
shell: bash
run: |
version="$(packaging/linux/version.sh)"
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Packaging requires a numeric MAJOR.MINOR.PATCH version, got: $version" >&2
exit 1
fi
if [[ "$GITHUB_REF_TYPE" == tag && "$GITHUB_REF_NAME" != "v$version" ]]; then
echo "Tag $GITHUB_REF_NAME does not match Cargo.toml version $version" >&2
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
if [[ "$GITHUB_REF_TYPE" != tag ]]; then
echo 'Build only: download packages from this run’s Artifacts section. To publish, push a matching vMAJOR.MINOR.PATCH tag.' >> "$GITHUB_STEP_SUMMARY"
fi
verify:
name: Release checks
needs: prepare
uses: ./.github/workflows/ci.yml
deb:
name: Debian package
needs: prepare
runs-on: ubuntu-24.04
# Debian 13 has Qt 6.8; the app needs 6.5 or newer.
container: debian:trixie
env:
QMAKE: /usr/lib/qt6/bin/qmake
steps:
- name: Install build dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends \
build-essential pkg-config curl ca-certificates git dpkg-dev \
libsqlite3-dev \
qt6-base-dev qt6-base-dev-tools qt6-base-private-dev \
qt6-declarative-dev qt6-declarative-dev-tools \
liblayershellqtinterface-dev libwayland-dev
- uses: actions/checkout@v4
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: dtolnay/rust-toolchain@stable
- run: packaging/linux/deb/build-deb.sh dist
- uses: actions/upload-artifact@v4
with:
name: deb
path: dist/*.deb
if-no-files-found: error
deb-install:
name: Install .deb on ${{ matrix.image }}
needs: deb
runs-on: ubuntu-24.04
container: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
image: ['debian:trixie', 'ubuntu:rolling']
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: deb
path: dist
- name: Install the package with its dependencies
run: |
apt-get update
apt-get install -y ./dist/*.deb
- run: packaging/linux/smoke-test.sh
rpm:
name: Fedora package
needs: prepare
runs-on: ubuntu-24.04
container: fedora:latest
steps:
- name: Install build dependencies
run: |
dnf install -y git rpm-build cargo rust gcc-c++ \
qt6-qtbase-devel qt6-qtbase-private-devel qt6-qtdeclarative-devel \
layer-shell-qt-devel wayland-devel sqlite-devel \
desktop-file-utils libappstream-glib
- uses: actions/checkout@v4
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- run: packaging/linux/rpm/build-rpm.sh dist
- uses: actions/upload-artifact@v4
with:
name: rpm
path: dist/*.rpm
if-no-files-found: error
rpm-install:
name: Install .rpm on Fedora
needs: rpm
runs-on: ubuntu-24.04
container: fedora:latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: rpm
path: dist
- run: dnf install -y ./dist/*.rpm
- run: packaging/linux/smoke-test.sh
arch:
name: Arch Linux package
needs: prepare
runs-on: ubuntu-24.04
container: archlinux:latest
steps:
- name: Install build dependencies
run: |
pacman -Syu --noconfirm --needed base-devel git rust \
qt6-base qt6-declarative qt6-wayland layer-shell-qt sqlite hicolor-icon-theme
# makepkg refuses to run as root.
useradd --create-home builder
- uses: actions/checkout@v4
- name: Build with makepkg
run: |
chown -R builder "$GITHUB_WORKSPACE"
su builder -c "git config --global --add safe.directory '$GITHUB_WORKSPACE' && packaging/linux/arch/build-arch.sh dist"
- uses: actions/upload-artifact@v4
with:
name: arch
path: dist/*.pkg.tar.zst
if-no-files-found: error
arch-install:
name: Install package on Arch Linux
needs: arch
runs-on: ubuntu-24.04
container: archlinux:latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: arch
path: dist
- run: |
pacman -Syu --noconfirm
pacman -U --noconfirm dist/*.pkg.tar.zst
- run: packaging/linux/smoke-test.sh
appimage:
name: AppImage
needs: prepare
# The AppImage runs where glibc is at least as new as here: 2022 onwards.
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential pkg-config libsqlite3-dev libgl1-mesa-dev libegl1 \
libxkbcommon-x11-0 libxcb-cursor0 libxcb-icccm4 libxcb-image0 \
libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 \
libxcb-xinerama0 libxcb-xkb1 libwayland-cursor0 libwayland-egl1 \
libfontconfig1 libdbus-1-3 \
cmake libwayland-dev libwayland-bin libxkbcommon-dev
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
# 6.9 is the first Qt to send the window icon to Wayland compositors
# (xdg-toplevel-icon), which the taskbar shows before installation.
# The bundled LayerShellQt 6.7 needs 6.10; older pairs make resizing
# desktop notes stutter.
version: '6.11.2'
cache: true
# Notes become desktop widgets on Wayland through LayerShellQt, which
# has to be built for the bundled Qt.
- run: packaging/linux/build-layer-shell-qt.sh
env:
QMAKE: ${{ env.QT_ROOT_DIR }}/bin/qmake
- uses: dtolnay/rust-toolchain@stable
- run: packaging/linux/appimage/build-appimage.sh dist
env:
QMAKE: ${{ env.QT_ROOT_DIR }}/bin/qmake
- uses: actions/upload-artifact@v4
with:
name: appimage
path: dist/*.AppImage
if-no-files-found: error
appimage-run:
name: Run AppImage on Ubuntu 24.04
needs: appimage
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: appimage
path: dist
- name: Install what every desktop has
# AppImages leave out the graphics driver libraries on purpose; the
# headless runner lacks them, unlike any desktop system.
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libegl1 libgl1 libopengl0 libfontconfig1
- run: |
chmod +x dist/*.AppImage
packaging/linux/smoke-test.sh "$(ls "$PWD"/dist/*.AppImage)"
env:
# No FUSE on the runner; let the AppImage unpack itself.
APPIMAGE_EXTRACT_AND_RUN: '1'
flatpak:
name: Flatpak bundle
needs: prepare
runs-on: ubuntu-24.04
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.9
options: --privileged
steps:
- uses: actions/checkout@v4
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
manifest-path: packaging/linux/flatpak/org.betternotes.BetterNotes.yaml
bundle: BetterNotes.flatpak
cache-key: flatpak-builder-${{ github.sha }}
upload-artifact: false
- uses: actions/upload-artifact@v4
with:
name: flatpak
path: BetterNotes.flatpak
if-no-files-found: error
release:
name: Publish GitHub release
if: startsWith(github.ref, 'refs/tags/v')
needs: [prepare, verify, deb-install, rpm-install, arch-install, appimage-run, flatpak]
runs-on: ubuntu-24.04
permissions:
contents: write
env:
VERSION: ${{ needs.prepare.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Prepare source archive and checksums
shell: bash
run: |
git archive --format=tar.gz --prefix="BetterNotes-$VERSION/" \
--output="dist/BetterNotes-$VERSION-source.tar.gz" HEAD
cd dist
mv BetterNotes.flatpak "BetterNotes-$VERSION-x86_64.flatpak"
# Explicit globs fail if any format is missing and exclude unrelated artifacts.
sha256sum -- *.deb *.rpm *.pkg.tar.zst *.AppImage *.flatpak *-source.tar.gz > SHA256SUMS
sha256sum --check SHA256SUMS
- uses: softprops/action-gh-release@v3
with:
name: BetterNotes v${{ needs.prepare.outputs.version }}
body: |
Linux preview of BetterNotes: independent sticky windows, autosave,
rich text, search, tags, themes, reminders, attachments, import/export,
backups and a CLI. Notes stay on your machine without an account.
**Downloads (x86_64 / amd64):** Debian `.deb`, Fedora `.rpm`,
Arch `.pkg.tar.zst`, portable `.AppImage`, and a `.flatpak` bundle.
The source archive and `SHA256SUMS` are included below.
Download your package and `SHA256SUMS` together, then run
`sha256sum --check --ignore-missing SHA256SUMS` and confirm `OK`.
See the [README](https://github.com/thebanri/BetterNotes#install)
for installation and desktop limitations. Flatpak currently lacks
host KWin integration and working host autostart. Desktop-wide Quick
Capture needs a custom shortcut; reminders need the app running.
# Every published version becomes the repository's Latest release;
# GitHub never shows a prerelease as Latest.
prerelease: false
make_latest: true
fail_on_unmatched_files: true
files: |
dist/*.deb
dist/*.rpm
dist/*.pkg.tar.zst
dist/*.AppImage
dist/*.flatpak
dist/*-source.tar.gz
dist/SHA256SUMS
generate_release_notes: true