-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path.gitlab-ci.yml
59 lines (54 loc) · 1.71 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
stages:
- build
- deploy
build-linux:
stage: build
image: ubuntu:20.04
script:
- apt update && apt install -y build-essential xz-utils git wget curl
- ./pleasew -a linux_amd64 test -p -v 2 ...
- ./pleasew -a linux_amd64 build -p -v 2 ...
artifacts:
paths:
- plz-out/bin/protoc-gen-persist*
expire_in: 30mins
build-osx-intel:
stage: build
tags:
- osx-intel
script:
- ./pleasew -a darwin_amd64 test -p -v 2 ...
- ./pleasew -a darwin_amd64 build -p -v 2 ...
artifacts:
paths:
- plz-out/bin/protoc-gen-persist*
expire_in: 30mins
build-osx-arm64:
stage: build
tags:
- osx-arm64
script:
- ./pleasew -a darwin_arm64 test -p -v 2 ...
- ./pleasew -a darwin_arm64 build -p -v 2 ...
- mv plz-out/bin/darwin_arm64/protoc-gen-persist* plz-out/bin
artifacts:
paths:
- plz-out/bin/protoc-gen-persist*
expire_in: 30mins
deploy:
stage: deploy
image: ubuntu:20.04
dependencies:
- build-linux
- build-osx-intel
- build-osx-arm64
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 .
- ls -lR plz-out/bin
- mkdir artifacts
- for i in plz-out/bin/protoc-gen-persist*; do cp $i protoc-gen-persist; tar cjvf artifacts/$(basename $i).tar.gz protoc-gen-persist; done
- ./ghr -t ${GITHUB_TOKEN} -u tcncloud -r protoc-gen-persist -c ${CI_COMMIT_SHA} -replace ${CI_COMMIT_TAG} ./artifacts/