Files
pkl/.github/jobs/BuildNativeJob.pkl
Daniel Chao e5577ed8f0 Fix release builds (#1317)
In order to preserve the folder hierarchy in our uploaded artifact,
we need to insert a wildcard in the root path.

Also, fix fan-in of tasks that lead to the publish test result task.
2025-12-03 09:44:01 -08:00

46 lines
1.1 KiB
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)"
// Need to insert a wildcard to make actions/upload-artifact preserve the folder hierarchy.
// See https://github.com/actions/upload-artifact/issues/206
path = "\(project)*/build/executable/**/*"
}
}
}