ci: emit single self-launching AppImage artifact (no extra files, no host FUSE required)
All checks were successful
electron-linux-arm64 / electron-linux-arm64 (push) Successful in 1m0s
electron-linux-amd64 / electron-linux-amd64 (push) Successful in 1m33s

This commit is contained in:
OpenClaw Bot 2026-03-14 21:36:43 +00:00
parent cb11e3c8ad
commit 2c449514be
3 changed files with 40 additions and 34 deletions

View File

@ -36,7 +36,7 @@ jobs:
set -eu set -eu
npm run build:linux:amd64 npm run build:linux:amd64
- name: Collect run-specific artifact (+ no-fuse launcher) - name: Collect single consumer artifact (no-FUSE compatible)
run: | run: |
set -eu set -eu
rm -rf artifacts rm -rf artifacts
@ -44,15 +44,25 @@ jobs:
appimage=$(find dist -maxdepth 1 -type f -name '*.AppImage' | head -n 1 || true) appimage=$(find dist -maxdepth 1 -type f -name '*.AppImage' | head -n 1 || true)
[ -n "$appimage" ] || { echo 'AppImage missing'; exit 1; } [ -n "$appimage" ] || { echo 'AppImage missing'; exit 1; }
out="artifacts/electron_tray_demo-linux-amd64-run${{ github.run_number }}.AppImage" out="artifacts/electron_tray_demo-linux-amd64-run${{ github.run_number }}.AppImage"
cp "$appimage" "$out" cat > "$out" <<'SH'
chmod +x "$out"
cat > "artifacts/run-electron_tray_demo-linux-amd64-run${{ github.run_number }}-no-fuse.sh" <<'SH'
#!/usr/bin/env sh #!/usr/bin/env sh
set -eu set -eu
cd "$(dirname "$0")" self="$0"
APPIMAGE_EXTRACT_AND_RUN=1 ./electron_tray_demo-linux-amd64-run${{ github.run_number }}.AppImage workdir="$(mktemp -d)"
cleanup() { rm -rf "$workdir"; }
trap cleanup EXIT INT TERM
payload="$workdir/app.AppImage"
awk 'found { print } /^__APPIMAGE_PAYLOAD_BELOW__$/ { found=1; next }' "$self" | base64 -d > "$payload"
chmod +x "$payload"
APPIMAGE_EXTRACT_AND_RUN=1 "$payload" "$@"
exit $?
__APPIMAGE_PAYLOAD_BELOW__
SH SH
chmod +x "artifacts/run-electron_tray_demo-linux-amd64-run${{ github.run_number }}-no-fuse.sh" # remove YAML indentation from embedded launcher script
sed -i 's/^ //' "$out"
base64 -w 0 "$appimage" >> "$out"
echo >> "$out"
chmod +x "$out"
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

View File

@ -36,7 +36,7 @@ jobs:
set -eu set -eu
npm run build:linux:arm64 npm run build:linux:arm64
- name: Collect run-specific artifact (+ no-fuse launcher) - name: Collect single consumer artifact (no-FUSE compatible)
run: | run: |
set -eu set -eu
rm -rf artifacts rm -rf artifacts
@ -44,15 +44,25 @@ jobs:
appimage=$(find dist -maxdepth 1 -type f -name '*.AppImage' | head -n 1 || true) appimage=$(find dist -maxdepth 1 -type f -name '*.AppImage' | head -n 1 || true)
[ -n "$appimage" ] || { echo 'AppImage missing'; exit 1; } [ -n "$appimage" ] || { echo 'AppImage missing'; exit 1; }
out="artifacts/electron_tray_demo-linux-arm64-run${{ github.run_number }}.AppImage" out="artifacts/electron_tray_demo-linux-arm64-run${{ github.run_number }}.AppImage"
cp "$appimage" "$out" cat > "$out" <<'SH'
chmod +x "$out"
cat > "artifacts/run-electron_tray_demo-linux-arm64-run${{ github.run_number }}-no-fuse.sh" <<'SH'
#!/usr/bin/env sh #!/usr/bin/env sh
set -eu set -eu
cd "$(dirname "$0")" self="$0"
APPIMAGE_EXTRACT_AND_RUN=1 ./electron_tray_demo-linux-arm64-run${{ github.run_number }}.AppImage workdir="$(mktemp -d)"
cleanup() { rm -rf "$workdir"; }
trap cleanup EXIT INT TERM
payload="$workdir/app.AppImage"
awk 'found { print } /^__APPIMAGE_PAYLOAD_BELOW__$/ { found=1; next }' "$self" | base64 -d > "$payload"
chmod +x "$payload"
APPIMAGE_EXTRACT_AND_RUN=1 "$payload" "$@"
exit $?
__APPIMAGE_PAYLOAD_BELOW__
SH SH
chmod +x "artifacts/run-electron_tray_demo-linux-arm64-run${{ github.run_number }}-no-fuse.sh" # remove YAML indentation from embedded launcher script
sed -i 's/^ //' "$out"
base64 -w 0 "$appimage" >> "$out"
echo >> "$out"
chmod +x "$out"
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

View File

@ -27,26 +27,12 @@ Artifacts are produced via CI workflows:
- `electron-linux-amd64` - `electron-linux-amd64`
- `electron-linux-arm64` - `electron-linux-arm64`
## Running on Ubuntu 24.04+ without FUSE2 ## Ubuntu consumer behavior
Some fresh Ubuntu installs do not include `libfuse.so.2`, so direct AppImage execution may fail. CI now publishes exactly one executable artifact per architecture:
Use one of these options: - `electron_tray_demo-linux-<arch>-run<run>.AppImage`
```bash This file is a self-launching wrapper that runs the packaged AppImage with
# preferred package on Ubuntu 24.04+ `APPIMAGE_EXTRACT_AND_RUN=1`, so it works on fresh Ubuntu systems even when
sudo apt-get update && sudo apt-get install -y libfuse2t64 `libfuse.so.2` is not installed.
# then run AppImage normally
./electron_tray_demo-linux-<arch>-run<run>.AppImage
```
Or run without installing FUSE:
```bash
APPIMAGE_EXTRACT_AND_RUN=1 ./electron_tray_demo-linux-<arch>-run<run>.AppImage
```
CI artifacts also include a convenience launcher:
- `run-electron_tray_demo-linux-<arch>-run<run>-no-fuse.sh`