Add jpackageZip and Github actions for publishing binaries
This commit is contained in:
2
.github/workflows/build-on-commit.yaml
vendored
2
.github/workflows/build-on-commit.yaml
vendored
@@ -11,5 +11,5 @@ jobs:
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 14
|
||||
- name: Build apidocs
|
||||
- name: Build sources
|
||||
run: ./gradlew build
|
||||
30
.github/workflows/publish-binaries-linux-x64.yaml
vendored
Normal file
30
.github/workflows/publish-binaries-linux-x64.yaml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Publish Linux/x64 binaries
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v0.*
|
||||
- v0.*.*
|
||||
- v1.*
|
||||
- v1.*.*
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 14
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 14
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew jpackageZip
|
||||
- name: Create Release
|
||||
uses: ncipollo/release-action@v1.6.1
|
||||
id: create_release
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
allowUpdates: true
|
||||
replaceArtifacts: false
|
||||
body: Fully automated release
|
||||
artifacts: "./build/distributions/openrndr-application-linux-x64.zip"
|
||||
30
.github/workflows/publish-binaries-macos.yaml
vendored
Normal file
30
.github/workflows/publish-binaries-macos.yaml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Publish macOS binaries
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v0.*
|
||||
- v0.*.*
|
||||
- v1.*
|
||||
- v1.*.*
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 14
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 14
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew jpackageZip
|
||||
- name: Create Release
|
||||
uses: ncipollo/release-action@v1.6.1
|
||||
id: create_release
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
allowUpdates: true
|
||||
replaceArtifacts: false
|
||||
body: Fully automated release
|
||||
artifacts: "./build/distributions/openrndr-application-macos.zip"
|
||||
30
.github/workflows/publish-binaries-windows.yaml
vendored
Normal file
30
.github/workflows/publish-binaries-windows.yaml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Publish Windows binaries
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v0.*
|
||||
- v0.*.*
|
||||
- v1.*
|
||||
- v1.*.*
|
||||
-
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 14
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 14
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew jpackageZip
|
||||
- name: Create Release
|
||||
uses: ncipollo/release-action@v1.6.1
|
||||
id: create_release
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
allowUpdates: true
|
||||
replaceArtifacts: false
|
||||
body: Fully automated release
|
||||
artifacts: "./build/distributions/openrndr-application-windows.zip"
|
||||
@@ -12,7 +12,13 @@ You will find some [basic instructions](https://guide.openrndr.org/#/02_Getting_
|
||||
- `run` runs the TemplateProgram
|
||||
- `jar` creates an executable platform specific jar file with all dependencies
|
||||
- `zipDistribution` creates a zip file containing the application jar and the data folder
|
||||
- `jpackageZip` creates a zip with a stand-alone executable for the current platform (works with Java 14 only)
|
||||
|
||||
## Cross builds
|
||||
|
||||
To create runnable jars for a platform different from the platform you use to build one uses `./gradlew jar --PtargetPlatform=<platform>`. The supported platforms are `windows`, `macos`, `linux-x64` and `linux-arm64`. Note that the `linux-arm64` platform will only work with OPENRNDR snapshot builds from master and OPENRNDR 0.3.39 (a future version).
|
||||
|
||||
## Github Actions
|
||||
|
||||
This repository contains a number of Github Actions in `./github/workflows`.
|
||||
The actions enable a basic build run on commit, plus publication actions that are executed when
|
||||
a commit is tagged with a version number like `v0.*` or `v1.*`.
|
||||
@@ -1,3 +1,4 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||
@@ -46,7 +47,6 @@ val orxFeatures = setOf(
|
||||
|
||||
/* Which OPENRNDR libraries should be added to this project? */
|
||||
val openrndrFeatures = setOf(
|
||||
"panel",
|
||||
"video"
|
||||
)
|
||||
|
||||
@@ -93,6 +93,8 @@ val kotlinVersion = "1.3.72"
|
||||
plugins {
|
||||
java
|
||||
kotlin("jvm") version("1.3.72")
|
||||
id("com.github.johnrengelman.shadow") version ("5.2.0")
|
||||
id("org.beryx.runtime") version ("1.8.1")
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -182,29 +184,64 @@ tasks.withType<KotlinCompile> {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
|
||||
tasks.withType<Jar> {
|
||||
isZip64 = true
|
||||
manifest {
|
||||
attributes["Main-Class"] = applicationMainClass
|
||||
}
|
||||
doFirst {
|
||||
from(configurations.compileClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
|
||||
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
|
||||
}
|
||||
|
||||
exclude(listOf("META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA", "**/module-info*"))
|
||||
archiveFileName.set("application-$openrndrOs.jar")
|
||||
project.setProperty("mainClassName", applicationMainClass)
|
||||
tasks {
|
||||
named<ShadowJar>("shadowJar") {
|
||||
manifest {
|
||||
attributes["Main-Class"] = applicationMainClass
|
||||
}
|
||||
minimize {
|
||||
exclude(dependency("org.openrndr:openrndr-gl3:.*"))
|
||||
exclude(dependency("org.jetbrains.kotlin:kotlin-reflect:.*"))
|
||||
}
|
||||
}
|
||||
named<org.beryx.runtime.JPackageTask>("jpackage") {
|
||||
doLast {
|
||||
when (OperatingSystem.current()) {
|
||||
OperatingSystem.WINDOWS, OperatingSystem.LINUX -> {
|
||||
copy {
|
||||
from("data") {
|
||||
include("**/*")
|
||||
}
|
||||
into("build/jpackage/openrndr-application/data")
|
||||
}
|
||||
}
|
||||
OperatingSystem.MAC_OS -> {
|
||||
copy {
|
||||
from("data") {
|
||||
include("**/*")
|
||||
}
|
||||
into("build/jpackage/openrndr-application.app/data")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.create("zipDistribution", Zip::class.java) {
|
||||
archiveFileName.set("application-$openrndrOs.zip")
|
||||
from("./") {
|
||||
include("data/**")
|
||||
tasks.register<Zip>("jpackageZip") {
|
||||
archiveFileName.set("openrndr-application-$openrndrOs.zip")
|
||||
from("$buildDir/jpackage") {
|
||||
include("**/*")
|
||||
}
|
||||
from("$buildDir/libs/application-$openrndrOs.jar")
|
||||
}.dependsOn(tasks.jar)
|
||||
}
|
||||
tasks.findByName("jpackageZip")?.dependsOn("jpackage")
|
||||
|
||||
tasks.create("run", JavaExec::class.java) {
|
||||
main = applicationMainClass
|
||||
classpath = sourceSets.main.get().runtimeClasspath
|
||||
}.dependsOn(tasks.build)
|
||||
runtime {
|
||||
jpackage {
|
||||
imageName = "openrndr-application"
|
||||
skipInstaller = true
|
||||
if (OperatingSystem.current() == OperatingSystem.MAC_OS) {
|
||||
jvmArgs.add("-XstartOnFirstThread")
|
||||
}
|
||||
}
|
||||
options.empty()
|
||||
options.add("--strip-debug")
|
||||
options.add("--compress")
|
||||
options.add("1")
|
||||
options.add("--no-header-files")
|
||||
options.add("--no-man-pages")
|
||||
modules.empty()
|
||||
modules.add("jdk.unsupported")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user