Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c19219d

Browse files
committed
Revert "chore: Revert parallel Makefile builds (#3918)"
This reverts commit b077f71.
1 parent 8035265 commit c19219d

18 files changed

+566
-720
lines changed

.github/workflows/coder.yaml

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -500,35 +500,21 @@ 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-
506503
- name: Build Release
507504
run: |
508505
set -euo pipefail
509506
go mod download
510507
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
508+
version="$(./scripts/version.sh)"
509+
make -j \
510+
build/coder_"$version"_windows_amd64.zip \
511+
build/coder_"$version"_linux_amd64.{tar.gz,deb}
526512
527513
- name: Install Release
528514
run: |
529515
gcloud config set project coder-dogfood
530516
gcloud config set compute/zone us-central1-a
531-
gcloud compute scp ./dist/coder_*_linux_amd64.deb coder:/tmp/coder.deb
517+
gcloud compute scp ./build/coder_*_linux_amd64.deb coder:/tmp/coder.deb
532518
gcloud compute ssh coder -- sudo dpkg -i --force-confdef /tmp/coder.deb
533519
gcloud compute ssh coder -- sudo systemctl daemon-reload
534520
@@ -539,12 +525,9 @@ jobs:
539525
with:
540526
name: coder
541527
path: |
542-
./dist/*.zip
543-
./dist/*.exe
544-
./dist/*.tar.gz
545-
./dist/*.apk
546-
./dist/*.deb
547-
./dist/*.rpm
528+
./build/*.zip
529+
./build/*.tar.gz
530+
./build/*.deb
548531
retention-days: 7
549532

550533
test-js:

.github/workflows/release.yaml

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

7190
- name: Install zstd
7291
run: sudo apt-get install -y zstd
7392

74-
- name: Build Site
75-
run: make site/out/index.html
76-
7793
- name: Build Linux and Windows Binaries
7894
run: |
7995
set -euo pipefail
8096
go mod download
8197
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 \
98103
99104
- name: Build Linux Docker images
100105
run: |
101106
set -euxo pipefail
102107
103108
# 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
114116
115117
# we can't build multi-arch if the images aren't pushed, so quit now
116118
# if dry-running
@@ -120,14 +122,13 @@ jobs:
120122
fi
121123
122124
# 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
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
131132
./scripts/build_docker_multiarch.sh \
132133
--push \
133134
--target "$(./scripts/image_tag.sh --version latest)" \
@@ -139,11 +140,11 @@ jobs:
139140
with:
140141
name: linux
141142
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
147148
148149
# The mac binaries get built on mac runners because they need to be signed,
149150
# and the signing tool only runs on mac. This darwin job only builds the Mac
@@ -184,6 +185,18 @@ jobs:
184185
restore-keys: |
185186
js-${{ runner.os }}-
186187
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+
187200
- name: Install dependencies
188201
run: |
189202
set -euo pipefail
@@ -213,22 +226,11 @@ jobs:
213226
set -euo pipefail
214227
go mod download
215228
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
231232
env:
233+
CODER_SIGN_DARWIN: "1"
232234
AC_USERNAME: ${{ secrets.AC_USERNAME }}
233235
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
234236
AC_APPLICATION_IDENTITY: BDB050EB749EDD6A80C6F119BF1382ECA119CCCC
@@ -237,7 +239,7 @@ jobs:
237239
uses: actions/upload-artifact@v3
238240
with:
239241
name: darwin
240-
path: ./dist/coder_*.zip
242+
path: ./build/*.zip
241243

242244
publish:
243245
runs-on: ubuntu-latest
@@ -278,8 +280,11 @@ jobs:
278280
- name: Publish Helm
279281
run: |
280282
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/
283288
284289
- name: Publish Release
285290
run: |

.gitignore

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

3232
# Build
33+
build/
3334
dist/
3435
site/out/
3536

0 commit comments

Comments
 (0)