-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
40 lines (40 loc) · 1.42 KB
/
.gitlab-ci.yml
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
stages:
- build
- deploy
build:
stage: build
image: ubuntu:20.04
script:
- apt update && apt install -y build-essential xz-utils git wget curl
- ./pleasew test -p -v 2 ...
- ./pleasew build -p -v 2 //:wollemi
- ./pleasew build -a darwin_amd64 -p -v 2 //:wollemi
- ./pleasew build -a darwin_arm64 -p -v 2 //:wollemi
artifacts:
paths:
- plz-out/bin/wollemi
- plz-out/bin/darwin_amd64/wollemi
- plz-out/bin/darwin_arm64/wollemi
expire_in: 30mins
deploy:
stage: deploy
image: ubuntu:20.04
dependencies:
- build
only:
- tags
script:
- apt update && apt install -y curl bzip2
- curl -Lo - https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_linux_amd64.tar.gz | tar zxf -
- mv ghr_v0.13.0_linux_amd64/ghr .
- mkdir artifacts
- cp plz-out/bin/wollemi artifacts
- cd artifacts
- tar cjvf wollemi-${CI_COMMIT_TAG}-linux-amd64.tar.gz wollemi
- cp ../plz-out/bin/darwin_amd64/wollemi .
- tar cjvf wollemi-${CI_COMMIT_TAG}-darwin-amd64.tar.gz wollemi
- cp ../plz-out/bin/darwin_arm64/wollemi .
- tar cjvf wollemi-${CI_COMMIT_TAG}-darwin-arm64.tar.gz wollemi
- rm wollemi
- cd ..
- ./ghr -t ${GITHUB_TOKEN} -u tcncloud -r wollemi -c ${CI_COMMIT_SHA} -replace ${CI_COMMIT_TAG} ./artifacts/