mirror of
https://github.com/ovrport/app.git
synced 2026-10-27 03:19:56 -04:00
Add workflow and fixes for building universal JAR file and Linux (#19)
* Add GitHub Actions workflow for building Android and Desktop * Add workflow for building native deb and jar file * Fix line indentation * Change target formats --------- Co-authored-by: Pablo García Santamaría <69808296+PGSCOM@users.noreply.github.com> Co-authored-by: Mathew Tkachuk <me@crx.moe>
This commit is contained in:
2 files changed
+120
-1
No files matched your search
@@ -0,0 +1,101 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-android:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
cache: gradle
|
||||||
|
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
|
|
||||||
|
- name: Build Android APK
|
||||||
|
run: ./gradlew :composeApp:assembleRelease
|
||||||
|
|
||||||
|
- name: Upload Android APK
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: android-apk
|
||||||
|
path: composeApp/build/outputs/apk/release/*.apk
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
|
build-desktop-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
cache: gradle
|
||||||
|
|
||||||
|
- name: Build Desktop package
|
||||||
|
run: ./gradlew :composeApp:packageReleaseDistributionForCurrentOS
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Upload Desktop artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: desktop-windows
|
||||||
|
path: composeApp/build/compose/binaries/main-release/**/*
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
|
build-desktop-linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
cache: gradle
|
||||||
|
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
|
|
||||||
|
- name: Build Desktop package
|
||||||
|
run: ./gradlew :composeApp:packageReleaseDistributionForCurrentOS
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Build JAR package
|
||||||
|
run: ./gradlew :composeApp:packageUberJarForCurrentOS
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Upload Desktop artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: desktop-linux
|
||||||
|
path: composeApp/build/compose/binaries/main-release/**/*
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
|
- name: Upload JAR artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: desktop-jar
|
||||||
|
path: composeApp/build/compose/jars/*
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ compose.desktop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nativeDistributions {
|
nativeDistributions {
|
||||||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
targetFormats(TargetFormat.Dmg, TargetFormat.Exe, TargetFormat.AppImage)
|
||||||
packageName = "overport"
|
packageName = "overport"
|
||||||
packageVersion = appVersion
|
packageVersion = appVersion
|
||||||
|
|
||||||
@@ -120,3 +120,21 @@ compose.desktop {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType<org.gradle.jvm.tasks.Jar> {
|
||||||
|
// Need for valid signature check
|
||||||
|
exclude(
|
||||||
|
"META-INF/*.SF",
|
||||||
|
"META-INF/*.DSA",
|
||||||
|
"META-INF/*.RSA",
|
||||||
|
"META-INF/*.EC"
|
||||||
|
)
|
||||||
|
|
||||||
|
exclude(
|
||||||
|
"META-INF/INDEX.LIST",
|
||||||
|
"META-INF/DEPENDENCIES",
|
||||||
|
"META-INF/LICENSE*",
|
||||||
|
"META-INF/NOTICE*"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
Reference in new issue
Block a user