@@ -73,50 +73,28 @@ jobs:
7373
7474 - name : Install nfpm
7575 run : go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.16.0
76-
7776 - name : Install zstd
7877 run : sudo apt-get install -y zstd
7978
80- - name : Build Site
81- run : make site/out/index.html
82-
8379 - name : Build Linux and Windows Binaries
8480 run : |
8581 set -euo pipefail
8682 go mod download
8783
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 \
10490
10591 - name : Build Linux Docker images
10692 run : |
10793 set -euxo pipefail
10894
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
12098
12199 # we can't build multi-arch if the images aren't pushed, so quit now
122100 # if dry-running
@@ -125,31 +103,30 @@ jobs:
125103 exit 0
126104 fi
127105
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
132109
133110 # if the current version is equal to the highest (according to semver)
134111 # version in the repo, also create a multi-arch image as ":latest" and
135112 # push it
136113 if [[ "$(git tag | grep '^v' | grep -vE '(rc|dev|-|\+|\/)' | sort -r --version-sort | head -n1)" == "v$(./scripts/version.sh)" ]]; then
137114 ./scripts/build_docker_multiarch.sh \
138- --push \
139115 --target "$(./scripts/image_tag.sh --version latest)" \
140- "${images[@]}"
116+ --push \
117+ $(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
141118 fi
142119
143120 - name : Upload binary artifacts
144121 uses : actions/upload-artifact@v3
145122 with :
146123 name : linux
147124 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
153130
154131 # The mac binaries get built on mac runners because they need to be signed,
155132 # and the signing tool only runs on mac. This darwin job only builds the Mac
@@ -211,30 +188,17 @@ jobs:
211188 # Used for compressing embedded slim binaries
212189 brew install zstd
213190
214- - name : Build Site
215- run : make site/out/index.html
216-
217191 - name : Build darwin Binaries (with signatures)
218192 run : |
219193 set -euo pipefail
220194 go mod download
221195
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
237200 env :
201+ CODER_SIGN_DARWIN : " 1"
238202 AC_USERNAME : ${{ secrets.AC_USERNAME }}
239203 AC_PASSWORD : ${{ secrets.AC_PASSWORD }}
240204 AC_APPLICATION_IDENTITY : BDB050EB749EDD6A80C6F119BF1382ECA119CCCC
@@ -243,7 +207,7 @@ jobs:
243207 uses : actions/upload-artifact@v3
244208 with :
245209 name : darwin
246- path : ./dist/coder_ *.zip
210+ path : ./build/ *.zip
247211
248212 publish :
249213 runs-on : ubuntu-latest
@@ -284,8 +248,11 @@ jobs:
284248 - name : Publish Helm
285249 run : |
286250 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/
289256
290257 - name : Publish Release
291258 run : |
0 commit comments