-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCreateRelease.pkl
49 lines (45 loc) · 1.06 KB
/
CreateRelease.pkl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
amends "package://pkg.pkl-lang.org/github.com/stefma/pkl-gha/[email protected]#/GitHubAction.pkl"
import "modules/Steps.pkl"
name = "CreateRelease"
on {
push {
tags {
"*"
}
}
}
permissions = new Permissions {
contents = "write"
}
jobs {
["createRelease"] {
`runs-on` = new UbuntuLatest {}
steps {
...Steps.checkoutAndInstallPkl()
new {
name = "Package pkl module"
run = "pkl project package"
env {
["VERSION"] = "${{ github.ref_name }}"
}
}
new {
name = "Extract version number from tag"
run = """
VERSION_NUMBER=${{ github.ref_name }}
VERSION_NUMBER=${VERSION_NUMBER#*@}
echo "VERSION_NUMBER=$VERSION_NUMBER" >> $GITHUB_ENV
"""
}
new {
uses = "softprops/action-gh-release@v2"
with {
["files"] = ".out/com.github.action@${{ env.VERSION_NUMBER }}/*"
["fail_on_unmatched_files"] = true
["prerelease"] = true
["draft"] = true
}
}
}
}
}