mirror of
https://github.com/apple/pkl.git
synced 2026-03-24 10:01:10 +01:00
This switches our builds over to GitHub Actions! TODO: * Add macOS/amd64 native-image builds; this isn't working right now * Patch musl with security patches * Add benchmark jobs over time As part of this build, PRBs will now only run `./gradlew check` on Linux, but other jobs can be run using slash commands, e.g. `[windows]` to run `./gradle check` on Windows.
48 lines
997 B
Plaintext
48 lines
997 B
Plaintext
extends "GradleJob.pkl"
|
|
|
|
import "@gha/actions/Artifact.pkl"
|
|
|
|
/// Whether to link to musl. Otherwise, links to glibc.
|
|
musl: Boolean(implies(module.os == "linux")) = false
|
|
|
|
/// The Gradle project under which to generate the executable
|
|
project: String
|
|
|
|
extraGradleArgs {
|
|
when (os == "macOS" && arch == "amd64") {
|
|
"-Dpkl.targetArch=\(module.arch)"
|
|
}
|
|
when (musl) {
|
|
"-Dpkl.musl=true"
|
|
}
|
|
}
|
|
|
|
|
|
steps {
|
|
when (musl) {
|
|
new {
|
|
name = "Install musl and zlib"
|
|
run = read("../scripts/install_musl.sh").text
|
|
}
|
|
}
|
|
new {
|
|
name = "gradle buildNative"
|
|
shell = "bash"
|
|
run =
|
|
"""
|
|
./gradlew \(module.gradleArgs) \(project):buildNative
|
|
"""
|
|
}
|
|
new Artifact.Upload {
|
|
name = "Upload executable artifacts"
|
|
with {
|
|
name =
|
|
if (musl)
|
|
"executable-\(project)-alpine-\(module.os)-\(module.arch)"
|
|
else
|
|
"executable-\(project)-\(module.os)-\(module.arch)"
|
|
path = "\(project)/build/executable/**/*"
|
|
}
|
|
}
|
|
}
|