Skip to content

Commit 9466398

Browse files
committed
ci: Add GitHub Actions workflow for building desktop distributions
This commit introduces a new GitHub Actions workflow (`.github/workflows/build-desktop.yml`) to automate the creation of native desktop application packages. The workflow is triggered on pushes to version tags (e.g., `v1.0.0`). It uses a matrix strategy to build for multiple operating systems: - **macOS:** Generates a `.dmg` file. - **Windows:** Generates an `.msi` file. - **Linux (Ubuntu):** Generates a `.deb` file. Each build job checks out the code, sets up JDK 17, and runs the corresponding Gradle task (`packageDmg`, `packageMsi`, `packageDeb`) to create the native package. The resulting artifact is then uploaded.
1 parent 0b7a867 commit 9466398

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build Desktop Distributions
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Runs on version tags like v1.0.0
7+
8+
jobs:
9+
build:
10+
name: Build for ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
include:
15+
- os: macos-latest
16+
format: dmg
17+
gradle_task: packageDmg
18+
- os: windows-latest
19+
format: msi
20+
gradle_task: packageMsi
21+
- os: ubuntu-latest
22+
format: deb
23+
gradle_task: packageDeb
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup JDK 17
30+
uses: actions/setup-java@v4
31+
with:
32+
distribution: 'temurin'
33+
java-version: '17'
34+
35+
- name: Grant execute permission for Gradlew
36+
if: runner.os != 'Windows'
37+
run: chmod +x gradlew
38+
39+
- name: Build native package
40+
run: ./gradlew ${{ matrix.gradle_task }} --stacktrace
41+
42+
- name: Upload artifact
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: build-${{ matrix.format }}
46+
path: build/compose/binaries/main/${{ matrix.format }}/

0 commit comments

Comments
 (0)