@@ -65,52 +65,54 @@ 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/[email protected]
70
+ - name : Install protoc-gen-go-drpc
71
+ run :
go install storj.io/drpc/cmd/[email protected]
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
+
68
87
- name : Install nfpm
69
88
run :
go install github.com/goreleaser/nfpm/v2/cmd/[email protected]
70
89
71
90
- name : Install zstd
72
91
run : sudo apt-get install -y zstd
73
92
74
- - name : Build Site
75
- run : make site/out/index.html
76
-
77
93
- name : Build Linux and Windows Binaries
78
94
run : |
79
95
set -euo pipefail
80
96
go mod download
81
97
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
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 \
98
103
99
104
- name : Build Linux Docker images
100
105
run : |
101
106
set -euxo pipefail
102
107
103
108
# build and (maybe) push Docker images for each architecture
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
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
114
116
115
117
# we can't build multi-arch if the images aren't pushed, so quit now
116
118
# if dry-running
@@ -120,14 +122,13 @@ jobs:
120
122
fi
121
123
122
124
# build and push multi-arch manifest
123
- ./scripts/build_docker_multiarch.sh \
124
- --push \
125
- "${images[@]}"
125
+ make -j push/build/coder_"$version"_linux.tag
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
131
132
./scripts/build_docker_multiarch.sh \
132
133
--push \
133
134
--target "$(./scripts/image_tag.sh --version latest)" \
@@ -139,11 +140,11 @@ jobs:
139
140
with :
140
141
name : linux
141
142
path : |
142
- dist /*.zip
143
- dist /*.tar.gz
144
- dist /*.apk
145
- dist /*.deb
146
- dist /*.rpm
143
+ ./build /*.zip
144
+ ./build /*.tar.gz
145
+ ./build /*.apk
146
+ ./build /*.deb
147
+ ./build /*.rpm
147
148
148
149
# The mac binaries get built on mac runners because they need to be signed,
149
150
# and the signing tool only runs on mac. This darwin job only builds the Mac
@@ -184,6 +185,18 @@ jobs:
184
185
restore-keys : |
185
186
js-${{ runner.os }}-
186
187
188
+ - name : Install protoc-gen-go
189
+ run :
go install google.golang.org/protobuf/cmd/[email protected]
190
+ - name : Install protoc-gen-go-drpc
191
+ run :
go install storj.io/drpc/cmd/[email protected]
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
+
187
200
- name : Install dependencies
188
201
run : |
189
202
set -euo pipefail
@@ -213,22 +226,11 @@ jobs:
213
226
set -euo pipefail
214
227
go mod download
215
228
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
229
+ version="$(./scripts/version.sh)"
230
+ make -j \
231
+ build/coder_"$version"_darwin_{amd64,arm64}.zip
231
232
env :
233
+ CODER_SIGN_DARWIN : " 1"
232
234
AC_USERNAME : ${{ secrets.AC_USERNAME }}
233
235
AC_PASSWORD : ${{ secrets.AC_PASSWORD }}
234
236
AC_APPLICATION_IDENTITY : BDB050EB749EDD6A80C6F119BF1382ECA119CCCC
@@ -237,7 +239,7 @@ jobs:
237
239
uses : actions/upload-artifact@v3
238
240
with :
239
241
name : darwin
240
- path : ./dist/coder_ *.zip
242
+ path : ./build/ *.zip
241
243
242
244
publish :
243
245
runs-on : ubuntu-latest
@@ -278,8 +280,11 @@ jobs:
278
280
- name : Publish Helm
279
281
run : |
280
282
set -euxo pipefail
281
- ./scripts/helm.sh --push
282
- mv ./dist/*.tgz ./artifacts/
283
+
284
+ version="$(./scripts/version.sh)"
285
+ make -j \
286
+ build/coder_helm_"$version".tgz
287
+ mv ./build/*.tgz ./artifacts/
283
288
284
289
- name : Publish Release
285
290
run : |
0 commit comments