-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
183 lines (175 loc) · 6.86 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
image: $IMAGE
stages:
- version
- build
- publish
version:
stage: version
script:
- release next-version --allow-current
- release next-version --allow-current > .next-version
- echo "RELEASE_SHA=$CI_COMMIT_SHA" > build_info
- echo "RELEASE_VERSION=$(cat .next-version)" >> build_info
- cat build_info
- . build_info
- echo $RELEASE_VERSION
artifacts:
paths:
- build_info
compile_linux-x64:
stage: build
before_script:
- source /etc/profile
- . build_info
- go get -v -d
- mc config host add scw-fr-par https://s3.fr-par.scw.cloud $SCW_AK $SCW_SK --api S3v4
- mkdir -p build
- cat $MINISIGN > build/minisign.key
- echo $MINISIGN_PASS > build/min_pass
- "ls -lah"
script:
- go build -o ./build/namegen -ldflags="-X=main.appVersion=$RELEASE_VERSION"
- cp build_info build/
- cd build
- zip namegen-$RELEASE_VERSION-linux-amd64.zip namegen build_info
- 'minisign -s minisign.key -Sm namegen-$RELEASE_VERSION-linux-amd64.zip -t "namegen $RELEASE_VERSION" < min_pass'
- "if [ $CI_COMMIT_REF_NAME = develop ]; then namegen_path=scw-fr-par/namegen/develop/; echo $namegen_path; elif [ $CI_COMMIT_REF_NAME = main ]; then namegen_path=scw-fr-par/namegen/; echo $namegen_path; fi;"
- "mc cp --attr x-amz-acl=public-read namegen-$RELEASE_VERSION-linux-amd64.zip $namegen_path"
- "mc cp --attr x-amz-acl=public-read namegen-$RELEASE_VERSION-linux-amd64.zip.minisig $namegen_path"
- "mc ls $namegen_path"
- "rm -f minisign.key"
- "rm -f min_pass"
artifacts:
paths:
- namegen
- build_info
compile_linux-arm64:
stage: build
before_script:
- source /etc/profile
- . build_info
- go get -v -d
- mc config host add scw-fr-par https://s3.fr-par.scw.cloud $SCW_AK $SCW_SK --api S3v4
- mkdir -p build
- cat $MINISIGN > build/minisign.key
- echo $MINISIGN_PASS > build/min_pass
- "ls -lah"
script:
- go build -o ./build/namegen -ldflags="-X=main.appVersion=$RELEASE_VERSION"
- cp build_info build/
- cd build
- zip namegen-$RELEASE_VERSION-linux-arm64.zip namegen build_info
- 'minisign -s minisign.key -Sm namegen-$RELEASE_VERSION-linux-arm64.zip -t "namegen $RELEASE_VERSION" < min_pass'
- "if [ $CI_COMMIT_REF_NAME = develop ]; then namegen_path=scw-fr-par/namegen/develop/; echo $namegen_path; elif [ $CI_COMMIT_REF_NAME = main ]; then namegen_path=scw-fr-par/namegen/; echo $namegen_path; fi;"
- "mc cp --attr x-amz-acl=public-read namegen-$RELEASE_VERSION-linux-arm64.zip $namegen_path"
- "mc cp --attr x-amz-acl=public-read namegen-$RELEASE_VERSION-linux-arm64.zip.minisig $namegen_path"
- "mc ls $namegen_path"
- "rm -f minisign.key"
- "rm -f min_pass"
artifacts:
paths:
- namegen
- build_info
tags:
- go-arm64
compile_windows:
stage: build
before_script:
- source /etc/profile
- . build_info
- go get -v -d
- mc config host add scw-fr-par https://s3.fr-par.scw.cloud $SCW_AK $SCW_SK --api S3v4
- mkdir -p build
- cat $MINISIGN > build/minisign.key
- echo $MINISIGN_PASS > build/min_pass
- "ls -lah"
script:
- GOOS=windows GOARCH=amd64 go build -o ./build/namegen.exe -ldflags="-X=main.appVersion=$version"
- cp build_info build/
- cd build
- zip namegen-$RELEASE_VERSION-windows-amd64.zip namegen.exe build_info
- 'minisign -s minisign.key -Sm namegen-$RELEASE_VERSION-windows-amd64.zip -t "namegen $RELEASE_VERSION" < min_pass'
- "if [ $CI_COMMIT_REF_NAME = develop ]; then namegen_path=scw-fr-par/namegen/develop/; echo $namegen_path; elif [ $CI_COMMIT_REF_NAME = main ]; then namegen_path=scw-fr-par/namegen/; echo $namegen_path; fi;"
- "mc cp --attr x-amz-acl=public-read namegen-$RELEASE_VERSION-windows-amd64.zip $namegen_path"
- "mc cp --attr x-amz-acl=public-read namegen-$RELEASE_VERSION-windows-amd64.zip.minisig $namegen_path"
- "mc ls $namegen_path"
- "rm -f minisign.key"
- "rm -f min_pass"
artifacts:
paths:
- namegen.exe
- build_info
compile_mac:
stage: build
before_script:
- . build_info
- go get -v -d
- mc config host add scw-fr-par https://s3.fr-par.scw.cloud $SCW_AK $SCW_SK --api S3v4
- mkdir -p build
- cat $MINISIGN > build/minisign.key
- echo $MINISIGN_PASS > build/min_pass
- cp .gon.hcl build_info namegen.entitlements build/
- "ls -lah"
script:
- GOOS=darwin GOARCH=amd64 go build -o ./build/namegen -ldflags="-X=main.appVersion=$RELEASE_VERSION"
- cd build
- gon --log-level info .gon.hcl
- rm -f ./namegen
- unzip namegen.zip
- ls -lah
- spctl -a -vv -t install namegen
- zip namegen-$RELEASE_VERSION-darwin-amd64.zip namegen build_info
- 'minisign -s minisign.key -Sm namegen-$RELEASE_VERSION-darwin-amd64.zip -t "namegen $RELEASE_VERSION" < min_pass'
- "if [ $CI_COMMIT_REF_NAME = develop ]; then namegen_path=scw-fr-par/namegen/develop/; echo $namegen_path; elif [ $CI_COMMIT_REF_NAME = main ]; then namegen_path=scw-fr-par/namegen/; echo $namegen_path; fi;"
- "mc cp --attr x-amz-acl=public-read namegen-$RELEASE_VERSION-darwin-amd64.zip $namegen_path"
- "mc cp --attr x-amz-acl=public-read namegen-$RELEASE_VERSION-darwin-amd64.zip.minisig $namegen_path"
- "mc ls $namegen_path"
- "rm -f minisign.key"
- "rm -f min_pass"
artifacts:
paths:
- namegen
- build_info
tags:
- go-mac
compile_mac_arm64:
stage: build
before_script:
- . build_info
- go get -v -d
- mc config host add scw-fr-par https://s3.fr-par.scw.cloud $SCW_AK $SCW_SK --api S3v4
- mkdir -p build
- cat $MINISIGN > build/minisign.key
- echo $MINISIGN_PASS > build/min_pass
- cp .gon.hcl build_info namegen.entitlements build/
- "ls -lah"
script:
- GOOS=darwin GOARCH=arm64 go build -o ./build/namegen -ldflags="-X=main.appVersion=$RELEASE_VERSION"
- cd build
- gon --log-level info .gon.hcl
- rm -f ./namegen
- unzip namegen.zip
- ls -lah
- spctl -a -vv -t install namegen
- zip namegen-$RELEASE_VERSION-darwin-arm64.zip namegen build_info
- 'minisign -s minisign.key -Sm namegen-$RELEASE_VERSION-darwin-arm64.zip -t "namegen $RELEASE_VERSION" < min_pass'
- "if [ $CI_COMMIT_REF_NAME = develop ]; then namegen_path=scw-fr-par/namegen/develop/; echo $namegen_path; elif [ $CI_COMMIT_REF_NAME = main ]; then namegen_path=scw-fr-par/namegen/; echo $namegen_path; fi;"
- "mc cp --attr x-amz-acl=public-read namegen-$RELEASE_VERSION-darwin-arm64.zip $namegen_path"
- "mc cp --attr x-amz-acl=public-read namegen-$RELEASE_VERSION-darwin-arm64.zip.minisig $namegen_path"
- "mc ls $namegen_path"
- "rm -f minisign.key"
- "rm -f min_pass"
artifacts:
paths:
- namegen
- build_info
tags:
- go-mac-arm64
publish:
stage: publish
script:
- release changelog
- release commit-and-tag CHANGELOG.md build_info
only:
- develop
- main