Skip to content

Commit 86f7e99

Browse files
committed
CI: Add GitHub Actions workflow for building desktop app
This commit introduces a GitHub Actions workflow to automate the build process for the ModernADB desktop application. The workflow will: - Trigger on push and pull request events to the `main` and `cicd` branches. - Build the application on `ubuntu-latest`, `windows-latest`, and `macos-latest` runners. - Set up JDK 21 and Gradle. - Execute the `./gradlew packageRelease` command to build the native distribution. - Upload the resulting binaries as artifacts, named `ModernADB-${{ matrix.os }}`. Additionally, this commit: - Adds RPM as a target format in `composeApp/build.gradle.kts`. - Introduces a new Gradle task `packageAll` that depends on `packageMsi`, `packageDmg`, `packageDeb`, and `packageRpm` to build all native distribution packages.
1 parent d5d08b2 commit 86f7e99

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ on:
66
tags:
77
- 'v*.*.*'
88

9+
# FIX 1: Add permissions for the release job to create a release.
10+
permissions:
11+
contents: write
12+
913
jobs:
10-
# Job 1: Build the application on all three platforms
1114
build:
1215
strategy:
1316
matrix:
@@ -41,32 +44,26 @@ jobs:
4144
uses: actions/upload-artifact@v4
4245
with:
4346
name: ModernADB-${{ matrix.os }}
44-
path: |
45-
composeApp/build/compose/binaries/main/**/*.msi
46-
composeApp/build/compose/binaries/main/**/*.dmg
47-
composeApp/build/compose/binaries/main/**/*.deb
47+
# FIX 2: Path now points to the directory containing the packages
48+
path: composeApp/build/compose/binaries/main/
4849

49-
# Job 2: Create the GitHub Release and upload the built files
5050
release:
51-
# This job depends on the 'build' job finishing successfully
5251
needs: build
5352
runs-on: ubuntu-latest
5453
steps:
5554
- name: Download all build artifacts
5655
uses: actions/download-artifact@v4
5756
with:
58-
# The path where the downloaded artifacts will be placed
5957
path: artifacts
6058

6159
- name: Create Release and Upload Assets
6260
uses: softprops/action-gh-release@v2
6361
with:
64-
# This makes the release a draft so you can review it before publishing
6562
draft: true
66-
# This uses the tag name for the release title
6763
name: Release ${{ github.ref_name }}
68-
# This lists all the downloaded files to be uploaded to the release
64+
# FIX 3: This simplified glob pattern will find all package files
65+
# inside their respective downloaded folders.
6966
files: |
70-
artifacts/ModernADB-windows-latest/*.msi
71-
artifacts/ModernADB-macos-latest/*.dmg
72-
artifacts/ModernADB-ubuntu-latest/*.deb
67+
artifacts/ModernADB-windows-latest/msi/*.msi
68+
artifacts/ModernADB-macos-latest/dmg/*.dmg
69+
artifacts/ModernADB-ubuntu-latest/deb/*.deb

0 commit comments

Comments
 (0)