Skip to content

Commit 9d41518

Browse files
authored
Bump pkl.impl.ghactions to 1.0.1 (#1358)
1 parent b7ccc67 commit 9d41518

File tree

14 files changed

+311
-178
lines changed

14 files changed

+311
-178
lines changed

.github/PklProject

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ amends "pkl:Project"
22

33
dependencies {
44
["pkl.impl.ghactions"] {
5-
uri = "package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@0.7.1"
5+
uri = "package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1.0.1"
66
}
77
["gha"] {
8-
uri = "package://pkg.pkl-lang.org/github.com/stefma/pkl-gha/com.github.[email protected]"
8+
uri = "package://pkg.pkl-lang.org/pkl-pantry/com.github.[email protected]"
99
}
1010
}

.github/PklProject.deps.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"schemaVersion": 1,
33
"resolvedDependencies": {
4-
"package://pkg.pkl-lang.org/github.com/stefma/pkl-gha/com.github.action@0": {
4+
"package://pkg.pkl-lang.org/pkl-pantry/com.github.actions@1": {
55
"type": "remote",
6-
"uri": "projectpackage://pkg.pkl-lang.org/github.com/stefma/pkl-gha/com.github.[email protected]",
6+
"uri": "projectpackage://pkg.pkl-lang.org/pkl-pantry/com.github.[email protected]",
77
"checksums": {
8-
"sha256": "84365239996740252a91abab084d443aa3a3438f375b667ac16cb765461c1555"
8+
"sha256": "efe5b1f58648baeac651e88107e13ceb58860c8e28ac18098b857445dc0185b7"
99
}
1010
},
11-
"package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@0": {
11+
"package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1": {
1212
"type": "remote",
13-
"uri": "projectpackage://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@0.7.1",
13+
"uri": "projectpackage://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1.0.1",
1414
"checksums": {
15-
"sha256": "f8efc4b174855a2fafdab8ed792de4b0cb89b0516d688c8540eea13af20e0f80"
15+
"sha256": "f6fcf3e3e580520ad526b92274c373a78f4ced3d2b0dd52e422fc3e0847f307f"
1616
}
1717
}
1818
}

.github/index.pkl

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -196,27 +196,3 @@ release {
196196
}
197197
} |> toWorkflowJobs
198198
}
199-
200-
output {
201-
files {
202-
[[true]] {
203-
renderer {
204-
converters {
205-
["jobs"] = (it: Mapping<String, Workflow.Job>) ->
206-
it
207-
.toMap()
208-
.mapValues((name, job) ->
209-
if (name.contains("linux") && !name.contains("alpine"))
210-
job
211-
.toMap()
212-
.put("container", new Dynamic {
213-
image = "redhat/ubi8:8.10"
214-
})
215-
else
216-
job
217-
)
218-
}
219-
}
220-
}
221-
}
222-
}

.github/jobs/BuildJavaExecutableJob.pkl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
extends "GradleJob.pkl"
22

3-
import "@gha/actions/Artifact.pkl"
4-
import "@gha/actions/Common.pkl"
3+
import "@gha/catalog.pkl"
54

65
// Keep this in sync with projects that build java executables
76
local projects: List<String> = List("pkl-doc", "pkl-cli", "pkl-codegen-java", "pkl-codegen-kotlin")
@@ -17,13 +16,13 @@ local command =
1716
}.join(" ")
1817

1918
steps {
20-
new Common.Checkout {}
19+
catalog.`actions/checkout@v6`
2120
new {
2221
name = "gradle build java executables"
2322
shell = "bash"
2423
run = command
2524
}
26-
new Artifact.Upload {
25+
(catalog.`actions/upload-artifact@v5`) {
2726
name = "Upload executable artifacts"
2827
with {
2928
name = "executable-java"

.github/jobs/BuildNativeJob.pkl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
extends "GradleJob.pkl"
22

3-
import "@gha/actions/Artifact.pkl"
4-
import "@gha/Context.pkl"
3+
import "@gha/catalog.pkl"
4+
import "@gha/context.pkl"
55

66
/// Whether to link to musl. Otherwise, links to glibc.
77
musl: Boolean(implies(module.os == "linux")) = false
@@ -12,7 +12,7 @@ project: String
1212
extraGradleArgs {
1313
when (os == "macOS" && arch == "amd64") {
1414
"-Dpkl.targetArch=\(module.arch)"
15-
"-Dpkl.native--native-compiler-path=\(Context.github.workspace)/.github/scripts/cc_macos_amd64.sh"
15+
"-Dpkl.native--native-compiler-path=\(context.github.workspace)/.github/scripts/cc_macos_amd64.sh"
1616
}
1717
when (musl) {
1818
"-Dpkl.musl=true"
@@ -48,7 +48,7 @@ steps {
4848
shell = "bash"
4949
run = "./gradlew \(module.gradleArgs) \(project):buildNative"
5050
}
51-
new Artifact.Upload {
51+
(catalog.`actions/upload-artifact@v5`) {
5252
name = "Upload executable artifacts"
5353
with {
5454
name =
@@ -62,3 +62,11 @@ steps {
6262
}
6363
}
6464
}
65+
66+
fixed job {
67+
when (os == "linux" && !musl) {
68+
container {
69+
image = "redhat/ubi8:8.10"
70+
}
71+
}
72+
}

.github/jobs/DeployJob.pkl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
extends "GradleJob.pkl"
22

3-
import "@gha/actions/Artifact.pkl"
4-
import "@gha/actions/Common.pkl"
3+
import "@gha/catalog.pkl"
54
import "@gha/Workflow.pkl"
65
import "@pkl.impl.ghactions/helpers.pkl"
76

@@ -14,8 +13,8 @@ arch = "amd64"
1413
os = "linux"
1514

1615
steps {
17-
new Common.Checkout {}
18-
new Artifact.Download {
16+
catalog.`actions/checkout@v6`
17+
(catalog.`actions/download-artifact@v5`) {
1918
with {
2019
pattern = "executable-**"
2120
`merge-multiple` = true

.github/jobs/GithubRelease.pkl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ module GithubRelease
22

33
extends "PklJob.pkl"
44

5-
import "@gha/actions/Artifact.pkl"
6-
import "@gha/Context.pkl"
5+
import "@gha/catalog.pkl"
6+
import "@gha/context.pkl"
77

88
fixed job {
99
`runs-on` = "ubuntu-latest"
@@ -12,7 +12,7 @@ fixed job {
1212
}
1313
needs = "deploy-release"
1414
steps {
15-
new Artifact.Download {
15+
(catalog.`actions/download-artifact@v5`) {
1616
with {
1717
pattern = "executable-**"
1818
`merge-multiple` = true
@@ -21,10 +21,10 @@ fixed job {
2121
new {
2222
name = "Publish release on GitHub"
2323
env {
24-
["GH_TOKEN"] = Context.github.token
25-
["TAG_NAME"] = Context.github.refName
26-
["GIT_SHA"] = Context.github.sha
27-
["GH_REPO"] = Context.github.repository
24+
["GH_TOKEN"] = context.github.token
25+
["TAG_NAME"] = context.github.refName
26+
["GIT_SHA"] = context.github.sha
27+
["GH_REPO"] = context.github.repository
2828
}
2929
// language=bash
3030
run =

.github/jobs/GradleJob.pkl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ abstract module GradleJob
22

33
extends "PklJob.pkl"
44

5-
import "@gha/actions/Common.pkl"
6-
import "@gha/actions/Setup.pkl"
75
import "@gha/Workflow.pkl"
6+
import "@gha/catalog.pkl"
87

98
/// Whether this is a release build or not.
109
isRelease: Boolean = false
@@ -21,9 +20,9 @@ nightlyMacOS: Boolean(implies(os == "macOS")) = false
2120

2221
extraGradleArgs: Listing<String>
2322

24-
steps: Listing<*Workflow.Step | Workflow.TypedStep>
23+
steps: Listing<Workflow.Step>
2524

26-
preSteps: Listing<*Workflow.Step | Workflow.TypedStep>
25+
preSteps: Listing<Workflow.Step>
2726

2827
/// The fetch depth to use when doing a git checkout.
2928
fetchDepth: Int?
@@ -73,14 +72,14 @@ fixed job {
7372
steps {
7473
...preSteps
7574
// full checkout (needed for spotless)
76-
new Common.Checkout {
75+
(catalog.`actions/checkout@v6`) {
7776
when (fetchDepth != null) {
7877
with {
7978
`fetch-depth` = fetchDepth
8079
}
8180
}
8281
}
83-
new Setup.Java {
82+
(catalog.`actions/setup-java@v5`) {
8483
with {
8584
`java-version` = "21"
8685
distribution = "temurin"

0 commit comments

Comments
 (0)