Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/build-desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build Desktop

on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Java
uses: actions/setup-java@v5
with:
java-version: '21'

Copilot AI Dec 26, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a Java version mismatch between the workflow and the project configuration. The workflow specifies Java 21, but the Android target in composeApp/build.gradle.kts (lines 21-23, 137-139) is configured to use Java 11 (JVM_11 and JavaVersion.VERSION_11). While Java 21 can compile Java 11 bytecode, this mismatch could lead to unexpected issues or inconsistencies.

Consider either:

  1. Using Java 11 in the workflow to match the Android configuration, or
  2. Updating the Android configuration to use Java 21 if that's the intended target, or
  3. Using Java 17 as a middle ground if the desktop application specifically requires a newer Java version

For a desktop-only build workflow, Java 21 might be acceptable if the JVM target doesn't involve Android compilation.

Suggested change
java-version: '21'
java-version: '11'

Copilot uses AI. Check for mistakes.
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5

- name: Build with Gradle
run: ./gradlew composeApp:jvmJar

Copilot AI Dec 26, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow executes the Gradle wrapper script ./gradlew directly without ensuring it has execute permissions. In some cases, the checked-out repository may not preserve the executable bit on the gradlew script, which would cause this step to fail.

Consider adding chmod +x gradlew before running the Gradle command, or alternatively, use sh gradlew to explicitly run it through the shell. This ensures the workflow is more robust across different checkout scenarios.

Suggested change
run: ./gradlew composeApp:jvmJar
run: sh gradlew composeApp:jvmJar

Copilot uses AI. Check for mistakes.

Copilot AI Dec 26, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Gradle task composeApp:jvmJar appears to be incorrect for building a Compose Desktop application. According to the project's AGENTS.md documentation (line 57), the correct task for desktop is ./gradlew run. For CI/CD purposes where you want to build the desktop application, you should use one of the following tasks:

  • packageDistributionForCurrentOS - to create a native distribution package for the current OS
  • createDistributable - to create a distributable application
  • jvmJar (without the composeApp: prefix) - to build just the JAR

The task composeApp:jvmJar is not a standard Compose Desktop task and is not referenced anywhere in the project configuration. Consider using ./gradlew packageDistributionForCurrentOS or ./gradlew createDistributable for a complete build.

Suggested change
run: ./gradlew composeApp:jvmJar
run: ./gradlew packageDistributionForCurrentOS

Copilot uses AI. Check for mistakes.
Loading