-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.drone.jsonnet
54 lines (53 loc) · 1.45 KB
/
.drone.jsonnet
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
50
51
52
53
54
local Pipeline(name, version) = {
kind: "pipeline",
type: "docker",
name: name,
steps: [
{
name: "build",
image: "rust:" + version,
pull: "if-not-exists",
commands: [
"cargo build --verbose --all --release",
"mkdir -p dist",
"cp target/release/zsh-histdb-skim dist/zsh-histdb-skim-linux-x64",
]
},
{
name: "build darwin",
image: "joseluisq/rust-linux-darwin-builder:" + version,
pull: "if-not-exists",
commands: [
"cargo build --verbose --all --release --target x86_64-apple-darwin",
"mkdir -p dist",
"cp target/x86_64-apple-darwin/release/zsh-histdb-skim dist/zsh-histdb-skim-darwin-x64",
"cargo test --verbose --all"
]
},
{
name: "release",
image: "alpine:latest",
pull: "if-not-exists",
environment:{
GH_TOKEN: {
from_secret: "github_release",
},
},
commands: [
"echo $GH_TOKEN",
"export GH_REPO=m42e/zsh-histdb-skim",
"apk --no-cache add wget tar",
"wget https://github.com/cli/cli/releases/download/v2.6.0/gh_2.6.0_linux_amd64.tar.gz",
"tar -zxvf gh_2.6.0_linux_amd64.tar.gz",
"chmod a+x gh_2.6.0_linux_amd64/bin/gh",
"gh_2.6.0_linux_amd64/bin/gh release create --target ${DRONE_COMMIT} ${DRONE_TAG} dist/*",
],
when: {
event: 'tag'
},
}
]
};
[
Pipeline("rust-1-68", "1.68"),
]