Skip to content

Commit e59379d

Browse files
committed
[Experiment] Generate .AppImage.zsync files for automatic updates
1 parent ba16073 commit e59379d

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/ci-linux.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@ jobs:
3030
submodules: recursive
3131
- name: Package and test application in container
3232
uses: pol-rivero/desktop-ubuntu-arm64-packaging@268f378f0fcea447cbb773ccf5bdc82f7389dcce
33+
- name: Generate AppImage zsync
34+
run: script/generate-appimage-zsync.sh dist/*.AppImage arm64
3335
- name: Upload output artifacts
3436
uses: actions/upload-artifact@v4
3537
with:
3638
name: ubuntu-arm64-artifacts
3739
path: |
3840
dist/*.AppImage
41+
dist/*.AppImage.zsync
3942
dist/*.deb
4043
dist/*.rpm
4144
dist/*.sha256
@@ -54,12 +57,15 @@ jobs:
5457
submodules: recursive
5558
- name: Package and test application in container
5659
uses: pol-rivero/desktop-ubuntu-arm-packaging@2d4df8604295eb7bf767101c365435e7e029e3df
60+
- name: Generate AppImage zsync
61+
run: script/generate-appimage-zsync.sh dist/*.AppImage armv7l
5762
- name: Upload output artifacts
5863
uses: actions/upload-artifact@v4
5964
with:
6065
name: ubuntu-arm-artifacts
6166
path: |
6267
dist/*.AppImage
68+
dist/*.AppImage.zsync
6369
dist/*.deb
6470
dist/*.rpm
6571
dist/*.sha256
@@ -78,12 +84,15 @@ jobs:
7884
submodules: recursive
7985
- name: Package and test application in container
8086
uses: pol-rivero/desktop-ubuntu-amd64-packaging@fd44033e38ccc986e39ed8e7a6d38640506e8bde
87+
- name: Generate AppImage zsync
88+
run: script/generate-appimage-zsync.sh dist/*.AppImage x86_64
8189
- name: Upload output artifacts
8290
uses: actions/upload-artifact@v4
8391
with:
8492
name: ubuntu-amd64-artifacts
8593
path: |
8694
dist/*.AppImage
95+
dist/*.AppImage.zsync
8796
dist/*.deb
8897
dist/*.rpm
8998
dist/*.sha256
@@ -142,6 +151,7 @@ jobs:
142151
Upstream: [GitHub Desktop ${{ env.VERSION_WITHOUT_V }} release notes](https://github.com/desktop/desktop/releases/tag/release-${{ env.VERSION_WITHOUT_V }})
143152
files: |
144153
artifacts/**/*.AppImage
154+
artifacts/**/*.AppImage.zsync
145155
artifacts/**/*.deb
146156
artifacts/**/*.rpm
147157
draft: false

script/generate-appimage-zsync.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
APPIMAGE_FILE="$1"
6+
ARCH="$2"
7+
if [ -z "$APPIMAGE_FILE" ] || [ -z "$ARCH" ]; then
8+
echo "Usage: $0 <AppImage file> <architecture>"
9+
exit 1
10+
fi
11+
12+
REPO_OWNER="pol-rivero"
13+
REPO_NAME="github-desktop-plus"
14+
RELEASES_ZSYNC_PATTERN="GitHubDesktopPlus-*-linux-$ARCH.AppImage.zsync"
15+
16+
# Extract AppImage contents
17+
cd "$(dirname "$APPIMAGE_FILE")"
18+
chmod +x "$APPIMAGE_FILE"
19+
"./$APPIMAGE_FILE" --appimage-extract
20+
21+
TAG="latest" # https://github.com/AppImage/AppImageSpec/blob/master/draft.md#release-name-values
22+
UPDATE_INFO="gh-releases-zsync|$REPO_OWNER|$REPO_NAME|$TAG|$RELEASES_ZSYNC_PATTERN"
23+
24+
curl -L -o appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
25+
chmod +x appimagetool
26+
27+
# Embed update info and re-pack (this will generate the .zsync file)
28+
./appimagetool -u "$UPDATE_INFO" squashfs-root "$APPIMAGE_FILE"
29+
30+
# Cleanup
31+
rm -rf squashfs-root appimagetool

0 commit comments

Comments
 (0)