chore: Build for macos
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
name: Build & Test Desktop JAR
|
||||
|
||||
name: Build & Test Desktop
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
@@ -7,32 +6,53 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-jar:
|
||||
runs-on: ubuntu-latest # your Linux k3s runner
|
||||
# ---- Tests run once on Linux; both build jobs depend on this ----
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v4
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "21"
|
||||
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x ./gradlew
|
||||
|
||||
# Runs commonTest + jvmTest. If a test fails, the job stops here and no jar is built.
|
||||
- run: chmod +x ./gradlew
|
||||
- name: Run tests
|
||||
run: ./gradlew --no-daemon jvmTest
|
||||
|
||||
# Cross-platform uber jar (see the build.gradle.kts note below for macOS support)
|
||||
- name: Build uber jar
|
||||
run: ./gradlew --no-daemon packageUberJarForCurrentOS
|
||||
|
||||
- name: Upload jar artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
# ---- Portable fat jar (Linux + macOS arm64 Skiko bundled) ----
|
||||
build-jar:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest # your k3s runners
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "21"
|
||||
- run: chmod +x ./gradlew
|
||||
- name: Build fat jar
|
||||
run: ./gradlew --no-daemon desktopFatJar
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: adbkey-uber-jar
|
||||
path: "**/build/compose/jars/*.jar"
|
||||
path: "**/build/libs/adbkey-all.jar"
|
||||
if-no-files-found: error
|
||||
|
||||
# ---- Native DMG built ON macOS (jpackage needs the target OS) ----
|
||||
build-dmg:
|
||||
needs: test
|
||||
runs-on: macos # match the label of YOUR registered macOS runner
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "21"
|
||||
- run: chmod +x ./gradlew
|
||||
- name: Build DMG
|
||||
run: ./gradlew --no-daemon packageDistributionForCurrentOS
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: adbkey-macos-dmg
|
||||
path: "**/build/compose/binaries/main/dmg/*.dmg"
|
||||
if-no-files-found: error
|
||||
Reference in New Issue
Block a user