mirror of
https://github.com/apple/pkl.git
synced 2026-03-24 10:01:10 +01:00
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.
This commit is contained in:
47
.github/jobs/BuildNativeJob.pkl
vendored
Normal file
47
.github/jobs/BuildNativeJob.pkl
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
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/**/*"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user