@@ -73,50 +73,28 @@ jobs:
73
73
74
74
- name : Install nfpm
75
75
run : go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.16.0
76
-
77
76
- name : Install zstd
78
77
run : sudo apt-get install -y zstd
79
78
80
- - name : Build Site
81
- run : make site/out/index.html
82
-
83
79
- name : Build Linux and Windows Binaries
84
80
run : |
85
81
set -euo pipefail
86
82
go mod download
87
83
88
- mkdir -p ./dist
89
- # build slim binaries
90
- ./scripts/build_go_slim.sh \
91
- --output ./dist/ \
92
- --compress 22 \
93
- linux:amd64,armv7,arm64 \
94
- windows:amd64,arm64 \
95
- darwin:amd64,arm64
96
-
97
- # build linux and windows binaries
98
- ./scripts/build_go_matrix.sh \
99
- --output ./dist/ \
100
- --archive \
101
- --package-linux \
102
- linux:amd64,armv7,arm64 \
103
- windows:amd64,arm64
84
+ version="$(./scripts/version.sh)"
85
+ make gen/mark-fresh
86
+ make -j \
87
+ -W coderd/database/querier.go \
88
+ build/coder_"$version"_linux_{amd64,arm64,armv7}.{tar.gz,apk,deb,rpm} \
89
+ build/coder_"$version"_windows_{amd64,arm64}.zip \
104
90
105
91
- name : Build Linux Docker images
106
92
run : |
107
93
set -euxo pipefail
108
94
109
- # build and (maybe) push Docker images for each architecture
110
- images=()
111
- for arch in amd64 armv7 arm64; do
112
- img="$(
113
- ./scripts/build_docker.sh \
114
- ${{ (!github.event.inputs.dry_run && !github.event.inputs.snapshot) && '--push' || '' }} \
115
- --arch "$arch" \
116
- ./dist/coder_*_linux_"$arch"
117
- )"
118
- images+=("$img")
119
- done
95
+ # build Docker images for each architecture
96
+ version="$(./scripts/version.sh)"
97
+ make -j build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
120
98
121
99
# we can't build multi-arch if the images aren't pushed, so quit now
122
100
# if dry-running
@@ -125,31 +103,30 @@ jobs:
125
103
exit 0
126
104
fi
127
105
128
- # build and push multi-arch manifest
129
- ./scripts/build_docker_multiarch.sh \
130
- --push \
131
- "${images[@]}"
106
+ # build and push multi-arch manifest, this depends on the other images
107
+ # being pushed so will automatically push them.
108
+ make -j push/build/coder_"$version"_linux.tag
132
109
133
110
# if the current version is equal to the highest (according to semver)
134
111
# version in the repo, also create a multi-arch image as ":latest" and
135
112
# push it
136
113
if [[ "$(git tag | grep '^v' | grep -vE '(rc|dev|-|\+|\/)' | sort -r --version-sort | head -n1)" == "v$(./scripts/version.sh)" ]]; then
137
114
./scripts/build_docker_multiarch.sh \
138
- --push \
139
115
--target "$(./scripts/image_tag.sh --version latest)" \
140
- "${images[@]}"
116
+ --push \
117
+ $(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
141
118
fi
142
119
143
120
- name : Upload binary artifacts
144
121
uses : actions/upload-artifact@v3
145
122
with :
146
123
name : linux
147
124
path : |
148
- dist /*.zip
149
- dist /*.tar.gz
150
- dist /*.apk
151
- dist /*.deb
152
- dist /*.rpm
125
+ ./build /*.zip
126
+ ./build /*.tar.gz
127
+ ./build /*.apk
128
+ ./build /*.deb
129
+ ./build /*.rpm
153
130
154
131
# The mac binaries get built on mac runners because they need to be signed,
155
132
# and the signing tool only runs on mac. This darwin job only builds the Mac
@@ -211,30 +188,17 @@ jobs:
211
188
# Used for compressing embedded slim binaries
212
189
brew install zstd
213
190
214
- - name : Build Site
215
- run : make site/out/index.html
216
-
217
191
- name : Build darwin Binaries (with signatures)
218
192
run : |
219
193
set -euo pipefail
220
194
go mod download
221
195
222
- mkdir -p ./dist
223
- # build slim binaries
224
- ./scripts/build_go_slim.sh \
225
- --output ./dist/ \
226
- --compress 22 \
227
- linux:amd64,armv7,arm64 \
228
- windows:amd64,arm64 \
229
- darwin:amd64,arm64
230
-
231
- # build darwin binaries
232
- ./scripts/build_go_matrix.sh \
233
- --output ./dist/ \
234
- --archive \
235
- --sign-darwin \
236
- darwin:amd64,arm64
196
+ version="$(./scripts/version.sh)"
197
+ make gen/mark-fresh
198
+ make -j \
199
+ build/coder_"$version"_darwin_{amd64,arm64}.zip
237
200
env :
201
+ CODER_SIGN_DARWIN : " 1"
238
202
AC_USERNAME : ${{ secrets.AC_USERNAME }}
239
203
AC_PASSWORD : ${{ secrets.AC_PASSWORD }}
240
204
AC_APPLICATION_IDENTITY : BDB050EB749EDD6A80C6F119BF1382ECA119CCCC
@@ -243,7 +207,7 @@ jobs:
243
207
uses : actions/upload-artifact@v3
244
208
with :
245
209
name : darwin
246
- path : ./dist/coder_ *.zip
210
+ path : ./build/ *.zip
247
211
248
212
publish :
249
213
runs-on : ubuntu-latest
@@ -284,8 +248,11 @@ jobs:
284
248
- name : Publish Helm
285
249
run : |
286
250
set -euxo pipefail
287
- ./scripts/helm.sh --push
288
- mv ./dist/*.tgz ./artifacts/
251
+
252
+ version="$(./scripts/version.sh)"
253
+ make -j \
254
+ build/coder_helm_"$version".tgz
255
+ mv ./build/*.tgz ./artifacts/
289
256
290
257
- name : Publish Release
291
258
run : |
0 commit comments