Files
pkl/.github/jobs/BuildNativeJob.pkl
Daniel Chao f948ba2a20 Switch to GitHub Actions (#1315)
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.
2025-11-13 16:03:05 -08:00

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/**/*"
}
}
}