Skip to content

Commit 1b64ce1

Browse files
Merge pull request #389 from QueryaHub/issue/382-linux-appimage
feat(ci): publish Linux AppImage on GitHub Releases
2 parents d0fb7df + 04a476b commit 1b64ce1

4 files changed

Lines changed: 97 additions & 7 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,20 @@ jobs:
119119
- name: Build Linux (release)
120120
run: flutter build linux --release
121121

122-
- name: Zip Linux artifact
122+
- name: Zip Linux artifact (portable)
123123
run: |
124124
cd build/linux/x64/release/bundle
125125
zip -r "${GITHUB_WORKSPACE}/Querya-Desktop-${{ steps.version.outputs.version }}-linux.zip" .
126126
127+
- name: Build Linux AppImage (installable)
128+
run: ./scripts/linux/build_appimage.sh
129+
127130
- uses: actions/upload-artifact@v4
128131
with:
129132
name: bundle-linux
130-
path: Querya-Desktop-${{ steps.version.outputs.version }}-linux.zip
133+
path: |
134+
Querya-Desktop-${{ steps.version.outputs.version }}-linux.zip
135+
Querya-Desktop-${{ steps.version.outputs.version }}-linux.AppImage
131136
if-no-files-found: error
132137

133138
build-macos:
@@ -241,10 +246,11 @@ jobs:
241246
run: |
242247
set -euo pipefail
243248
mkdir -p dist
244-
find artifacts -name '*.zip' -exec mv -t dist/ {} +
249+
find artifacts \( -name '*.zip' -o -name '*.AppImage' \) -exec mv -t dist/ {} +
245250
test "$(find dist -name '*.zip' | wc -l)" -eq 3
251+
test "$(find dist -name '*.AppImage' | wc -l)" -eq 1
246252
cd dist
247-
sha256sum *.zip | tee SHA256SUMS.txt
253+
sha256sum *.zip *.AppImage | tee SHA256SUMS.txt
248254
249255
- name: Build release notes from CHANGELOG.md
250256
run: |
@@ -265,7 +271,7 @@ jobs:
265271
echo "Optional USB-style profile: set \`QUERYA_PORTABLE=1\` or create a \`QueryaData/\` folder next to the binary (see docs/packaging.md)."
266272
echo ""
267273
echo "#### Installable"
268-
echo "_AppImage / Windows setup / distro packages — tracked in epic #379; not attached to this release yet._"
274+
echo "- **Linux AppImage**: \`Querya-Desktop-${VERSION}-linux.AppImage\` (\`chmod +x\` then run)"
269275
echo ""
270276
echo "Verify checksums: \`SHA256SUMS.txt\`"
271277
echo ""
@@ -292,6 +298,7 @@ jobs:
292298
fail_on_unmatched_files: true
293299
files: |
294300
dist/*.zip
301+
dist/*.AppImage
295302
dist/SHA256SUMS.txt
296303
env:
297304
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,7 @@ coverage/
4141
*.exe
4242
design-front/
4343
docker/sqlite/data/
44+
45+
# Local packaging outputs
46+
Querya-Desktop-*.AppImage
47+
Querya-Desktop-*.zip

‎docs/tags-and-releases.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@
3737

3838
Профиль по умолчанию всё равно в OS app-support; USB-style data → [packaging.md](packaging.md) (`QUERYA_PORTABLE` / `QueryaData/`).
3939

40-
### Installable channel (planned)
40+
### Installable channel
4141

42-
Отдельные артефакты (AppImage, Windows setup, deb/rpm/Flatpak) — epic [#379](https://github.com/QueryaHub/Querya-Desktop/issues/379). Пока в Release публикуются только portable zip выше.
42+
| Artifact | Notes |
43+
|----------|--------|
44+
| `Querya-Desktop-X.Y.Z-linux.AppImage` | [`scripts/linux/build_appimage.sh`](../scripts/linux/build_appimage.sh) (`chmod +x` then run) |
45+
46+
Windows setup / deb / rpm / Flatpak — epic [#379](https://github.com/QueryaHub/Querya-Desktop/issues/379).
4347

4448
## Changelog в GitHub Release
4549

‎scripts/linux/build_appimage.sh‎

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/usr/bin/env bash
2+
# Build Querya-Desktop-*.AppImage from a Flutter linux release bundle.
3+
#
4+
# Usage:
5+
# ./scripts/linux/build_appimage.sh [bundle_dir] [output_appimage]
6+
#
7+
# Defaults:
8+
# bundle_dir = build/linux/x64/release/bundle
9+
# output = Querya-Desktop-<pubspec-semver>-linux.AppImage
10+
set -euo pipefail
11+
12+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
13+
BUNDLE="${1:-$ROOT/build/linux/x64/release/bundle}"
14+
BINARY_NAME="querya_desktop"
15+
ICON_SRC="$ROOT/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png"
16+
17+
if [[ ! -d "$BUNDLE" ]]; then
18+
echo "error: Flutter linux bundle not found: $BUNDLE" >&2
19+
echo "Run: flutter build linux --release" >&2
20+
exit 1
21+
fi
22+
if [[ ! -x "$BUNDLE/$BINARY_NAME" ]]; then
23+
echo "error: missing executable: $BUNDLE/$BINARY_NAME" >&2
24+
exit 1
25+
fi
26+
if [[ ! -f "$ICON_SRC" ]]; then
27+
echo "error: icon not found: $ICON_SRC" >&2
28+
exit 1
29+
fi
30+
31+
VERSION="$(grep '^version:' "$ROOT/pubspec.yaml" | sed 's/^version: //; s/+.*//')"
32+
OUT="${2:-$ROOT/Querya-Desktop-${VERSION}-linux.AppImage}"
33+
34+
WORKDIR="$(mktemp -d "${TMPDIR:-/tmp}/querya-appimage.XXXXXX")"
35+
cleanup() { rm -rf "$WORKDIR"; }
36+
trap cleanup EXIT
37+
38+
APPDIR="$WORKDIR/AppDir"
39+
mkdir -p "$APPDIR"
40+
cp -a "$BUNDLE"/. "$APPDIR/"
41+
42+
cp "$ICON_SRC" "$APPDIR/${BINARY_NAME}.png"
43+
44+
cat > "$APPDIR/${BINARY_NAME}.desktop" <<EOF
45+
[Desktop Entry]
46+
Type=Application
47+
Name=Querya Desktop
48+
Comment=Multi-database desktop client
49+
Exec=${BINARY_NAME}
50+
Icon=${BINARY_NAME}
51+
Categories=Development;Database;
52+
Terminal=false
53+
StartupWMClass=querya_desktop
54+
X-AppImage-Version=${VERSION}
55+
EOF
56+
57+
cat > "$APPDIR/AppRun" <<'EOF'
58+
#!/bin/bash
59+
set -euo pipefail
60+
HERE="$(dirname "$(readlink -f "$0")")"
61+
export LD_LIBRARY_PATH="${HERE}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
62+
cd "$HERE"
63+
exec "$HERE/querya_desktop" "$@"
64+
EOF
65+
chmod +x "$APPDIR/AppRun" "$APPDIR/$BINARY_NAME"
66+
67+
TOOL="$WORKDIR/appimagetool"
68+
# Prefer type-2 continuous tool; --appimage-extract-and-run avoids FUSE on CI.
69+
curl -fsSL -o "$TOOL" \
70+
"https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
71+
chmod +x "$TOOL"
72+
73+
ARCH=x86_64 "$TOOL" --appimage-extract-and-run "$APPDIR" "$OUT"
74+
chmod +x "$OUT"
75+
echo "Wrote $OUT"

0 commit comments

Comments
 (0)