ci: emit single self-launching AppImage artifact (no extra files, no host FUSE required)
This commit is contained in:
@@ -36,7 +36,7 @@ jobs:
|
||||
set -eu
|
||||
npm run build:linux:amd64
|
||||
|
||||
- name: Collect run-specific artifact (+ no-fuse launcher)
|
||||
- name: Collect single consumer artifact (no-FUSE compatible)
|
||||
run: |
|
||||
set -eu
|
||||
rm -rf artifacts
|
||||
@@ -44,15 +44,25 @@ jobs:
|
||||
appimage=$(find dist -maxdepth 1 -type f -name '*.AppImage' | head -n 1 || true)
|
||||
[ -n "$appimage" ] || { echo 'AppImage missing'; exit 1; }
|
||||
out="artifacts/electron_tray_demo-linux-amd64-run${{ github.run_number }}.AppImage"
|
||||
cp "$appimage" "$out"
|
||||
chmod +x "$out"
|
||||
cat > "artifacts/run-electron_tray_demo-linux-amd64-run${{ github.run_number }}-no-fuse.sh" <<'SH'
|
||||
cat > "$out" <<'SH'
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")"
|
||||
APPIMAGE_EXTRACT_AND_RUN=1 ./electron_tray_demo-linux-amd64-run${{ github.run_number }}.AppImage
|
||||
self="$0"
|
||||
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
|
||||
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
|
||||
uses: actions/upload-artifact@v3
|
||||
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
set -eu
|
||||
npm run build:linux:arm64
|
||||
|
||||
- name: Collect run-specific artifact (+ no-fuse launcher)
|
||||
- name: Collect single consumer artifact (no-FUSE compatible)
|
||||
run: |
|
||||
set -eu
|
||||
rm -rf artifacts
|
||||
@@ -44,15 +44,25 @@ jobs:
|
||||
appimage=$(find dist -maxdepth 1 -type f -name '*.AppImage' | head -n 1 || true)
|
||||
[ -n "$appimage" ] || { echo 'AppImage missing'; exit 1; }
|
||||
out="artifacts/electron_tray_demo-linux-arm64-run${{ github.run_number }}.AppImage"
|
||||
cp "$appimage" "$out"
|
||||
chmod +x "$out"
|
||||
cat > "artifacts/run-electron_tray_demo-linux-arm64-run${{ github.run_number }}-no-fuse.sh" <<'SH'
|
||||
cat > "$out" <<'SH'
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")"
|
||||
APPIMAGE_EXTRACT_AND_RUN=1 ./electron_tray_demo-linux-arm64-run${{ github.run_number }}.AppImage
|
||||
self="$0"
|
||||
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
|
||||
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
|
||||
uses: actions/upload-artifact@v3
|
||||
|
||||
Reference in New Issue
Block a user