Skip to content

feat: add workflow for building desktop application - #8

Merged
SmilingPixel merged 1 commit into
mainfrom
dev/ci_cd
Dec 27, 2025
Merged

SmilingPixel merged 1 commit into
mainfrom
dev/ci_cd

Conversation

@SmilingPixel

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings December 26, 2025 01:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new GitHub Actions workflow for building the desktop application of the MarkDay Compose Multiplatform diary app. The workflow is configured to trigger on pushes to main and pull requests, with concurrency control to cancel in-progress runs.

Key Changes:

  • Adds automated CI/CD workflow for desktop builds using GitHub Actions
  • Configures Java 21 and Gradle build environment
  • Sets up build step to compile the desktop application

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.
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 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.
- 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.
@SmilingPixel
SmilingPixel merged commit d0cfd40 into main Dec 27, 2025
8 checks passed
@SmilingPixel
SmilingPixel deleted the dev/ci_cd branch December 27, 2025 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants