Skip to content

Commit ba49df4

Browse files
committed
feat(ci): add Linux AppImage build and upload to desktop workflow
This commit adds support for building and uploading Linux AppImages as part of the desktop platform CI workflow. The build is restricted to the 'modern' matrix label and includes a retry mechanism for stability. - **feat(ci)**: Added `Build Linux AppImage` step using `:composeApp:packageAppImage` Gradle task. - **feat(ci)**: Added a `retry` shell function to the AppImage build step to handle transient failures. - **feat(ci)**: Added `Upload Linux AppImage` step to archive the generated AppImage binaries. - **chore(ci)**: Increased artifact compression level for Linux installers.
1 parent 5a60d46 commit ba49df4

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/build-desktop-platforms.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,34 @@ jobs:
206206
retry ./gradlew :composeApp:packageDeb :composeApp:packageRpm
207207
shell: bash
208208

209+
- name: Build Linux AppImage
210+
if: matrix.label == 'modern'
211+
run: |
212+
set -euo pipefail
213+
214+
retry() {
215+
local n=1
216+
local max=3
217+
local delay=5
218+
while true; do
219+
echo "Attempt #$n: $*"
220+
if "$@"; then
221+
break
222+
fi
223+
if [ $n -ge $max ]; then
224+
echo "Command failed after $n attempts."
225+
return 1
226+
fi
227+
n=$((n+1))
228+
echo "Command failed — retrying in $delay seconds..."
229+
sleep $delay
230+
delay=$((delay*2))
231+
done
232+
}
233+
234+
retry ./gradlew :composeApp:packageAppImage
235+
shell: bash
236+
209237
- name: Upload Linux installers
210238
uses: actions/upload-artifact@v4
211239
with:
@@ -214,4 +242,14 @@ jobs:
214242
composeApp/build/compose/binaries/main/deb/*.deb
215243
composeApp/build/compose/binaries/main/rpm/*.rpm
216244
retention-days: 30
245+
compression-level: 6
246+
247+
- name: Upload Linux AppImage
248+
if: matrix.label == 'modern'
249+
uses: actions/upload-artifact@v4
250+
with:
251+
name: linux-appimage
252+
path: |
253+
composeApp/build/compose/binaries/main/app-image/
254+
retention-days: 30
217255
compression-level: 6

0 commit comments

Comments
 (0)