Conversation
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.
This commit updates the desktop build workflow to archive the Linux AppImage output into a `.tar.gz` file instead of uploading the raw directory. This ensures better compatibility and preservation of file permissions for Linux distributions. - **ci(github-actions)**: Added steps to list and locate the AppImage build output directory dynamically. - **ci(github-actions)**: Implemented a packaging step to compress the AppImage directory into `GitHub-Store-linux-x64.tar.gz`. - **ci(github-actions)**: Updated the `linux-appimage` artifact upload to use the newly created compressed archive.
WalkthroughAdds Gradle wrapper validation, cache cleanup and retry logic, expands the Linux build matrix, and introduces AppImage build/packaging/upload steps in the desktop GitHub Actions workflow. Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub Actions
participant Runner as OS Runner (linux macOS windows)
participant Gradle as Gradle Wrapper
participant FS as Filesystem
participant Upload as Actions Upload Artifact
GH->>Runner: start platform job (matrix)
Runner->>Gradle: validate gradle wrapper
Gradle-->>Runner: validation result
Runner->>Gradle: run install & build (with retry wrapper)
Gradle-->>FS: write build outputs (AppImage, deb, rpm, installers)
Runner->>FS: list AppImage output
Runner->>FS: package AppImage into tar.gz
Runner->>Upload: upload tar.gz and other installer artifacts
Upload-->>GH: artifact stored
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/build-desktop-platforms.yml (2)
246-270: Consider parameterizing the architecture in the artifact name.The filename
GitHub-Store-linux-x64.tar.gzhardcodes the architecture. Whileubuntu-latestcurrently runs on x64, making this explicit would improve clarity and future-proof the workflow if arm64 Linux builds are added later.♻️ Optional: Use a variable for architecture
- name: Package AppImage as tar.gz if: matrix.label == 'modern' run: | set -euo pipefail + ARCH="x64" # Matches ubuntu-latest runner architecture # Find the app-image output directory (could be app-image/ or app/) APPIMAGE_DIR="" ... - tar -czf composeApp/build/compose/binaries/main/GitHub-Store-linux-x64.tar.gz -C "$APPIMAGE_DIR" . + tar -czf "composeApp/build/compose/binaries/main/GitHub-Store-linux-${ARCH}.tar.gz" -C "$APPIMAGE_DIR" . echo "Created tar.gz archive:" - ls -lh composeApp/build/compose/binaries/main/GitHub-Store-linux-x64.tar.gz + ls -lh "composeApp/build/compose/binaries/main/GitHub-Store-linux-${ARCH}.tar.gz" shell: bashAnd update the upload step path accordingly.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/build-desktop-platforms.yml around lines 246 - 270, The artifact filename in the "Package AppImage as tar.gz" step hardcodes the architecture as GitHub-Store-linux-x64.tar.gz; change this to use a parameter/variable (e.g., ARCH or matrix.arch) so the tar command and any later upload paths use a templated name instead of x64. Update the tar invocation that writes to composeApp/build/compose/binaries/main/GitHub-Store-linux-x64.tar.gz and any references to that filename (including upload steps) to use the new ARCH variable, and ensure the variable is populated from your build matrix or an environment variable where the job defines the target architecture; keep APPIMAGE_DIR detection logic and only substitute the output filename.
209-235: Consider extracting the duplicatedretry()function.The
retry()function is now duplicated four times in this workflow (Windows, macOS, Linux DEB/RPM, and AppImage builds). This reduces maintainability—any change to retry behavior requires updating all four locations.Consider extracting it to:
- A shell script (e.g.,
.github/scripts/retry.sh) sourced by each step- A composite action
- A reusable workflow for the build pattern
♻️ Example: Extract to a shared script
Create
.github/scripts/retry.sh:#!/bin/bash retry() { local n=1 local max=3 local delay=5 while true; do echo "Attempt #$n: $*" if "$@"; then break fi if [ $n -ge $max ]; then echo "Command failed after $n attempts." return 1 fi n=$((n+1)) echo "Command failed — retrying in $delay seconds..." sleep $delay delay=$((delay*2)) done }Then in each step:
- name: Build Linux AppImage if: matrix.label == 'modern' run: | set -euo pipefail - - retry() { - local n=1 - ... - } - + source .github/scripts/retry.sh retry ./gradlew :composeApp:packageAppImage shell: bash🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/build-desktop-platforms.yml around lines 209 - 235, The duplicated retry() shell function used in multiple build steps (e.g., the "Build Linux AppImage" step) should be extracted to a single shared implementation and sourced by each job: create a single shared script containing retry(), make it executable, and update each step (Windows, macOS, Linux DEB/RPM, AppImage) to source that script before calling retry ./gradlew ...; alternatively implement the same shared behavior as a composite action or reusable workflow and replace the inline retry() definitions with a call to the shared module so future changes require editing only one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/build-desktop-platforms.yml:
- Around line 246-270: The artifact filename in the "Package AppImage as tar.gz"
step hardcodes the architecture as GitHub-Store-linux-x64.tar.gz; change this to
use a parameter/variable (e.g., ARCH or matrix.arch) so the tar command and any
later upload paths use a templated name instead of x64. Update the tar
invocation that writes to
composeApp/build/compose/binaries/main/GitHub-Store-linux-x64.tar.gz and any
references to that filename (including upload steps) to use the new ARCH
variable, and ensure the variable is populated from your build matrix or an
environment variable where the job defines the target architecture; keep
APPIMAGE_DIR detection logic and only substitute the output filename.
- Around line 209-235: The duplicated retry() shell function used in multiple
build steps (e.g., the "Build Linux AppImage" step) should be extracted to a
single shared implementation and sourced by each job: create a single shared
script containing retry(), make it executable, and update each step (Windows,
macOS, Linux DEB/RPM, AppImage) to source that script before calling retry
./gradlew ...; alternatively implement the same shared behavior as a composite
action or reusable workflow and replace the inline retry() definitions with a
call to the shared module so future changes require editing only one place.
This commit streamlines the GitHub Actions workflow for building desktop platforms by optimizing Gradle configurations, improving task management, and cleaning up redundant scripts. - **chore(github-actions)**: Added `org.gradle.vfs.watch=false` to Gradle options to improve CI performance. - **chore(github-actions)**: Integrated `gradle/actions/wrapper-validation` to verify the integrity of Gradle wrappers. - **chore(github-actions)**: Refactored Gradle setup to use `gradle-home-cache-cleanup` and removed redundant `cache: 'gradle'` from `setup-java`. - **refactor(github-actions)**: Simplified the `retry` shell function logic across all build jobs for better readability. - **feat(github-actions)**: Parametrized Linux build tasks using a `gradle-tasks` matrix variable, consolidating the AppImage build into a single step. - **chore**: Cleaned up whitespace and minor formatting in the workflow file.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/build-desktop-platforms.yml (1)
49-63: Centralize the duplicatedretry()helper to reduce maintenance burden.This workflow defines an identical
retry()function in three separate jobs (Windows, macOS, and Linux builds). Moving it to a reusable composite action or script keeps retry behavior consistent and eliminates the risk of divergent implementations if one definition is updated independently.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/build-desktop-platforms.yml around lines 49 - 63, The duplicated retry() helper function used in the Build Windows installers job should be extracted to a single reusable location and invoked from each platform job; create a reusable composite action or an executable script that implements retry() and replace the inline function in the Windows, macOS and Linux build jobs with a single call (e.g., run: ./scripts/retry -- ./gradlew :composeApp:packageExe :composeApp:packageMsi or uses: ./github/actions/retry-action with args) so the symbol retry() is defined once and every job (the Windows job that currently calls retry ./gradlew ...) delegates to that centralized implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/build-desktop-platforms.yml:
- Around line 49-63: The duplicated retry() helper function used in the Build
Windows installers job should be extracted to a single reusable location and
invoked from each platform job; create a reusable composite action or an
executable script that implements retry() and replace the inline function in the
Windows, macOS and Linux build jobs with a single call (e.g., run:
./scripts/retry -- ./gradlew :composeApp:packageExe :composeApp:packageMsi or
uses: ./github/actions/retry-action with args) so the symbol retry() is defined
once and every job (the Windows job that currently calls retry ./gradlew ...)
delegates to that centralized implementation.
Summary by CodeRabbit
New Features
Chores