Skip to content

Commit b077f71

Browse files
authored
chore: Revert parallel Makefile builds (coder#3918)
This was breaking the release process. Namely it was running the `gen` targets due to the dependency tree, which was failing on macOS and Linux runners. This revert can be reverted once we fix that up.
1 parent d2e6f30 commit b077f71

18 files changed

+720
-566
lines changed

.github/workflows/coder.yaml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -500,21 +500,35 @@ jobs:
500500
- name: Install zstd
501501
run: sudo apt-get install -y zstd
502502

503+
- name: Build site
504+
run: make -B site/out/index.html
505+
503506
- name: Build Release
504507
run: |
505508
set -euo pipefail
506509
go mod download
507510
508-
version="$(./scripts/version.sh)"
509-
make -j \
510-
build/coder_"$version"_windows_amd64.zip \
511-
build/coder_"$version"_linux_amd64.{tar.gz,deb}
511+
mkdir -p ./dist
512+
# build slim binaries
513+
./scripts/build_go_slim.sh \
514+
--output ./dist/ \
515+
--compress 22 \
516+
linux:amd64,armv7,arm64 \
517+
windows:amd64,arm64 \
518+
darwin:amd64,arm64
519+
520+
# build linux amd64 packages
521+
./scripts/build_go_matrix.sh \
522+
--output ./dist/ \
523+
--package-linux \
524+
linux:amd64 \
525+
windows:amd64
512526
513527
- name: Install Release
514528
run: |
515529
gcloud config set project coder-dogfood
516530
gcloud config set compute/zone us-central1-a
517-
gcloud compute scp ./build/coder_*_linux_amd64.deb coder:/tmp/coder.deb
531+
gcloud compute scp ./dist/coder_*_linux_amd64.deb coder:/tmp/coder.deb
518532
gcloud compute ssh coder -- sudo dpkg -i --force-confdef /tmp/coder.deb
519533
gcloud compute ssh coder -- sudo systemctl daemon-reload
520534
@@ -525,9 +539,12 @@ jobs:
525539
with:
526540
name: coder
527541
path: |
528-
./build/*.zip
529-
./build/*.tar.gz
530-
./build/*.deb
542+
./dist/*.zip
543+
./dist/*.exe
544+
./dist/*.tar.gz
545+
./dist/*.apk
546+
./dist/*.deb
547+
./dist/*.rpm
531548
retention-days: 7
532549

533550
test-js:

.github/workflows/release.yaml

Lines changed: 55 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -65,54 +65,52 @@ jobs:
6565
restore-keys: |
6666
js-${{ runner.os }}-
6767
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-
8768
- name: Install nfpm
8869
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.16.0
8970

9071
- name: Install zstd
9172
run: sudo apt-get install -y zstd
9273

74+
- name: Build Site
75+
run: make site/out/index.html
76+
9377
- name: Build Linux and Windows Binaries
9478
run: |
9579
set -euo pipefail
9680
go mod download
9781
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
10398
10499
- name: Build Linux Docker images
105100
run: |
106101
set -euxo pipefail
107102
108103
# 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
116114
117115
# we can't build multi-arch if the images aren't pushed, so quit now
118116
# if dry-running
@@ -122,13 +120,14 @@ jobs:
122120
fi
123121
124122
# 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[@]}"
126126
127127
# if the current version is equal to the highest (according to semver)
128128
# version in the repo, also create a multi-arch image as ":latest" and
129129
# push it
130130
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
132131
./scripts/build_docker_multiarch.sh \
133132
--push \
134133
--target "$(./scripts/image_tag.sh --version latest)" \
@@ -140,11 +139,11 @@ jobs:
140139
with:
141140
name: linux
142141
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
148147
149148
# The mac binaries get built on mac runners because they need to be signed,
150149
# and the signing tool only runs on mac. This darwin job only builds the Mac
@@ -185,18 +184,6 @@ jobs:
185184
restore-keys: |
186185
js-${{ runner.os }}-
187186
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-
200187
- name: Install dependencies
201188
run: |
202189
set -euo pipefail
@@ -226,11 +213,22 @@ jobs:
226213
set -euo pipefail
227214
go mod download
228215
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
232231
env:
233-
CODER_SIGN_DARWIN: "1"
234232
AC_USERNAME: ${{ secrets.AC_USERNAME }}
235233
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
236234
AC_APPLICATION_IDENTITY: BDB050EB749EDD6A80C6F119BF1382ECA119CCCC
@@ -239,7 +237,7 @@ jobs:
239237
uses: actions/upload-artifact@v3
240238
with:
241239
name: darwin
242-
path: ./build/*.zip
240+
path: ./dist/coder_*.zip
243241

244242
publish:
245243
runs-on: ubuntu-latest
@@ -280,11 +278,8 @@ jobs:
280278
- name: Publish Helm
281279
run: |
282280
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/
288283
289284
- name: Publish Release
290285
run: |

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ site/**/*.typegen.ts
3030
site/build-storybook.log
3131

3232
# Build
33-
build/
3433
dist/
3534
site/out/
3635

0 commit comments

Comments
 (0)