Skip to content

Commit e490bdd

Browse files
authored
revert: Makefile buff-ification (#3700) (#3848)
This caused the following issues: - Slim binaries weren't being updated. - The coder.tar.ztd was misplaced. - There is no coder.sha1 file with proper filenames. This should be reintroduced in a future change with those fixes.
1 parent d350d90 commit e490bdd

16 files changed

+716
-524
lines changed

.github/workflows/coder.yaml

+25-8
Original file line numberDiff line numberDiff line change
@@ -498,21 +498,35 @@ jobs:
498498
- name: Install zstd
499499
run: sudo apt-get install -y zstd
500500

501+
- name: Build site
502+
run: make -B site/out/index.html
503+
501504
- name: Build Release
502505
run: |
503506
set -euo pipefail
504507
go mod download
505508
506-
version="$(./scripts/version.sh)"
507-
make -j \
508-
build/coder_"$version"_windows_amd64.zip \
509-
build/coder_"$version"_linux_amd64.{tar.gz,deb}
509+
mkdir -p ./dist
510+
# build slim binaries
511+
./scripts/build_go_slim.sh \
512+
--output ./dist/ \
513+
--compress 22 \
514+
linux:amd64,armv7,arm64 \
515+
windows:amd64,arm64 \
516+
darwin:amd64,arm64
517+
518+
# build linux amd64 packages
519+
./scripts/build_go_matrix.sh \
520+
--output ./dist/ \
521+
--package-linux \
522+
linux:amd64 \
523+
windows:amd64
510524
511525
- name: Install Release
512526
run: |
513527
gcloud config set project coder-dogfood
514528
gcloud config set compute/zone us-central1-a
515-
gcloud compute scp ./build/coder_*_linux_amd64.deb coder:/tmp/coder.deb
529+
gcloud compute scp ./dist/coder_*_linux_amd64.deb coder:/tmp/coder.deb
516530
gcloud compute ssh coder -- sudo dpkg -i --force-confdef /tmp/coder.deb
517531
gcloud compute ssh coder -- sudo systemctl daemon-reload
518532
@@ -523,9 +537,12 @@ jobs:
523537
with:
524538
name: coder
525539
path: |
526-
./build/*.zip
527-
./build/*.tar.gz
528-
./build/*.deb
540+
./dist/*.zip
541+
./dist/*.exe
542+
./dist/*.tar.gz
543+
./dist/*.apk
544+
./dist/*.deb
545+
./dist/*.rpm
529546
retention-days: 7
530547

531548
test-js:

.github/workflows/release.yaml

+55-28
Original file line numberDiff line numberDiff line change
@@ -71,28 +71,46 @@ jobs:
7171
- name: Install zstd
7272
run: sudo apt-get install -y zstd
7373

74+
- name: Build Site
75+
run: make site/out/index.html
76+
7477
- name: Build Linux and Windows Binaries
7578
run: |
7679
set -euo pipefail
7780
go mod download
7881
79-
version="$(./scripts/version.sh)"
80-
make -j \
81-
build/coder_"$version"_linux_{amd64,armv7,arm64}.{tar.gz,apk,deb,rpm} \
82-
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
8398
8499
- name: Build Linux Docker images
85100
run: |
86101
set -euxo pipefail
87102
88103
# build and (maybe) push Docker images for each architecture
89-
version="$(./scripts/version.sh)"
90-
push=""
91-
if [[ "$CODER_RELEASE" == *t* ]]; then
92-
push="push/"
93-
fi
94-
make -j \
95-
"$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
96114
97115
# we can't build multi-arch if the images aren't pushed, so quit now
98116
# if dry-running
@@ -102,13 +120,14 @@ jobs:
102120
fi
103121
104122
# build and push multi-arch manifest
105-
make -j push/build/coder_"$version"_linux.tag
123+
./scripts/build_docker_multiarch.sh \
124+
--push \
125+
"${images[@]}"
106126
107127
# if the current version is equal to the highest (according to semver)
108128
# version in the repo, also create a multi-arch image as ":latest" and
109129
# push it
110130
if [[ "$(git tag | grep '^v' | grep -vE '(rc|dev|-|\+|\/)' | sort -r --version-sort | head -n1)" == "v$(./scripts/version.sh)" ]]; then
111-
make -j push/build/coder_"$version"_linux.tag
112131
./scripts/build_docker_multiarch.sh \
113132
--push \
114133
--target "$(./scripts/image_tag.sh --version latest)" \
@@ -120,11 +139,11 @@ jobs:
120139
with:
121140
name: linux
122141
path: |
123-
./build/*.zip
124-
./build/*.tar.gz
125-
./build/*.apk
126-
./build/*.deb
127-
./build/*.rpm
142+
dist/*.zip
143+
dist/*.tar.gz
144+
dist/*.apk
145+
dist/*.deb
146+
dist/*.rpm
128147
129148
# The mac binaries get built on mac runners because they need to be signed,
130149
# and the signing tool only runs on mac. This darwin job only builds the Mac
@@ -194,11 +213,22 @@ jobs:
194213
set -euo pipefail
195214
go mod download
196215
197-
version="$(./scripts/version.sh)"
198-
make -j \
199-
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
200231
env:
201-
CODER_SIGN_DARWIN: "1"
202232
AC_USERNAME: ${{ secrets.AC_USERNAME }}
203233
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
204234
AC_APPLICATION_IDENTITY: BDB050EB749EDD6A80C6F119BF1382ECA119CCCC
@@ -207,7 +237,7 @@ jobs:
207237
uses: actions/upload-artifact@v3
208238
with:
209239
name: darwin
210-
path: ./build/*.zip
240+
path: ./dist/coder_*.zip
211241

212242
publish:
213243
runs-on: ubuntu-latest
@@ -248,11 +278,8 @@ jobs:
248278
- name: Publish Helm
249279
run: |
250280
set -euxo pipefail
251-
252-
version="$(./scripts/version.sh)"
253-
make -j \
254-
build/coder_helm_"$version".tgz
255-
mv ./build/*.tgz ./artifacts/
281+
./scripts/helm.sh --push
282+
mv ./dist/*.tgz ./artifacts/
256283
257284
- name: Publish Release
258285
run: |

.gitignore

-1
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)