@@ -65,54 +65,52 @@ jobs:
65
65
restore-keys : |
66
66
js-${{ runner.os }}-
67
67
68
- - name : Install protoc-gen-go
69
- run : go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
70
- - name : Install protoc-gen-go-drpc
71
- run : go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26
72
- - name : Install goimports
73
- run : go install golang.org/x/tools/cmd/goimports@latest
74
-
75
- - name : Install Protoc
76
- run : |
77
- # protoc must be in lockstep with our dogfood Dockerfile
78
- # or the version in the comments will differ.
79
- set -x
80
- cd dogfood
81
- DOCKER_BUILDKIT=1 docker build . --target proto -t protoc
82
- protoc_path=/usr/local/bin/protoc
83
- docker run --rm --entrypoint cat protoc /tmp/bin/protoc > $protoc_path
84
- chmod +x $protoc_path
85
- protoc --version
86
-
87
68
- name : Install nfpm
88
69
run : go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.16.0
89
70
90
71
- name : Install zstd
91
72
run : sudo apt-get install -y zstd
92
73
74
+ - name : Build Site
75
+ run : make site/out/index.html
76
+
93
77
- name : Build Linux and Windows Binaries
94
78
run : |
95
79
set -euo pipefail
96
80
go mod download
97
81
98
- version="$(./scripts/version.sh)"
99
- make -j \
100
- -W coderd/database/querier.go \
101
- build/coder_"$version"_linux_{amd64,armv7,arm64}.{tar.gz,apk,deb,rpm} \
102
- build/coder_"$version"_windows_{amd64,arm64}.zip \
82
+ mkdir -p ./dist
83
+ # build slim binaries
84
+ ./scripts/build_go_slim.sh \
85
+ --output ./dist/ \
86
+ --compress 22 \
87
+ linux:amd64,armv7,arm64 \
88
+ windows:amd64,arm64 \
89
+ darwin:amd64,arm64
90
+
91
+ # build linux and windows binaries
92
+ ./scripts/build_go_matrix.sh \
93
+ --output ./dist/ \
94
+ --archive \
95
+ --package-linux \
96
+ linux:amd64,armv7,arm64 \
97
+ windows:amd64,arm64
103
98
104
99
- name : Build Linux Docker images
105
100
run : |
106
101
set -euxo pipefail
107
102
108
103
# build and (maybe) push Docker images for each architecture
109
- version="$(./scripts/version.sh)"
110
- push=""
111
- if [[ "$CODER_RELEASE" == *t* ]]; then
112
- push="push/"
113
- fi
114
- make -j \
115
- "$push"build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
104
+ images=()
105
+ for arch in amd64 armv7 arm64; do
106
+ img="$(
107
+ ./scripts/build_docker.sh \
108
+ ${{ (!github.event.inputs.dry_run && !github.event.inputs.snapshot) && '--push' || '' }} \
109
+ --arch "$arch" \
110
+ ./dist/coder_*_linux_"$arch"
111
+ )"
112
+ images+=("$img")
113
+ done
116
114
117
115
# we can't build multi-arch if the images aren't pushed, so quit now
118
116
# if dry-running
@@ -122,13 +120,14 @@ jobs:
122
120
fi
123
121
124
122
# build and push multi-arch manifest
125
- make -j push/build/coder_"$version"_linux.tag
123
+ ./scripts/build_docker_multiarch.sh \
124
+ --push \
125
+ "${images[@]}"
126
126
127
127
# if the current version is equal to the highest (according to semver)
128
128
# version in the repo, also create a multi-arch image as ":latest" and
129
129
# push it
130
130
if [[ "$(git tag | grep '^v' | grep -vE '(rc|dev|-|\+|\/)' | sort -r --version-sort | head -n1)" == "v$(./scripts/version.sh)" ]]; then
131
- make -j push/build/coder_"$version"_linux.tag
132
131
./scripts/build_docker_multiarch.sh \
133
132
--push \
134
133
--target "$(./scripts/image_tag.sh --version latest)" \
@@ -140,11 +139,11 @@ jobs:
140
139
with :
141
140
name : linux
142
141
path : |
143
- ./build /*.zip
144
- ./build /*.tar.gz
145
- ./build /*.apk
146
- ./build /*.deb
147
- ./build /*.rpm
142
+ dist /*.zip
143
+ dist /*.tar.gz
144
+ dist /*.apk
145
+ dist /*.deb
146
+ dist /*.rpm
148
147
149
148
# The mac binaries get built on mac runners because they need to be signed,
150
149
# and the signing tool only runs on mac. This darwin job only builds the Mac
@@ -185,18 +184,6 @@ jobs:
185
184
restore-keys : |
186
185
js-${{ runner.os }}-
187
186
188
- - name : Install protoc-gen-go
189
- run : go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
190
- - name : Install protoc-gen-go-drpc
191
- run : go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26
192
- - name : Install goimports
193
- run : go install golang.org/x/tools/cmd/goimports@latest
194
-
195
- - name : Install Protoc
196
- uses : arduino/setup-protoc@v1
197
- with :
198
- version : ' 3.x'
199
-
200
187
- name : Install dependencies
201
188
run : |
202
189
set -euo pipefail
@@ -226,11 +213,22 @@ jobs:
226
213
set -euo pipefail
227
214
go mod download
228
215
229
- version="$(./scripts/version.sh)"
230
- make -j \
231
- build/coder_"$version"_darwin_{amd64,arm64}.zip
216
+ mkdir -p ./dist
217
+ # build slim binaries
218
+ ./scripts/build_go_slim.sh \
219
+ --output ./dist/ \
220
+ --compress 22 \
221
+ linux:amd64,armv7,arm64 \
222
+ windows:amd64,arm64 \
223
+ darwin:amd64,arm64
224
+
225
+ # build darwin binaries
226
+ ./scripts/build_go_matrix.sh \
227
+ --output ./dist/ \
228
+ --archive \
229
+ --sign-darwin \
230
+ darwin:amd64,arm64
232
231
env :
233
- CODER_SIGN_DARWIN : " 1"
234
232
AC_USERNAME : ${{ secrets.AC_USERNAME }}
235
233
AC_PASSWORD : ${{ secrets.AC_PASSWORD }}
236
234
AC_APPLICATION_IDENTITY : BDB050EB749EDD6A80C6F119BF1382ECA119CCCC
@@ -239,7 +237,7 @@ jobs:
239
237
uses : actions/upload-artifact@v3
240
238
with :
241
239
name : darwin
242
- path : ./build/ *.zip
240
+ path : ./dist/coder_ *.zip
243
241
244
242
publish :
245
243
runs-on : ubuntu-latest
@@ -280,11 +278,8 @@ jobs:
280
278
- name : Publish Helm
281
279
run : |
282
280
set -euxo pipefail
283
-
284
- version="$(./scripts/version.sh)"
285
- make -j \
286
- build/coder_helm_"$version".tgz
287
- mv ./build/*.tgz ./artifacts/
281
+ ./scripts/helm.sh --push
282
+ mv ./dist/*.tgz ./artifacts/
288
283
289
284
- name : Publish Release
290
285
run : |
0 commit comments