58 lines
1.6 KiB
YAML
58 lines
1.6 KiB
YAML
name: Build & Test Desktop
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
tags: ["v*"]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
# ---- Tests run once on Linux; both build jobs depend on this ----
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: "21"
|
|
- run: chmod +x ./gradlew
|
|
- name: Run tests
|
|
run: ./gradlew --no-daemon jvmTest
|
|
|
|
# ---- 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/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 |