Skip to content

chore: Revert parallel Makefile builds #3918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions .github/workflows/coder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -500,21 +500,35 @@ jobs:
- name: Install zstd
run: sudo apt-get install -y zstd

- name: Build site
run: make -B site/out/index.html

- name: Build Release
run: |
set -euo pipefail
go mod download

version="$(./scripts/version.sh)"
make -j \
build/coder_"$version"_windows_amd64.zip \
build/coder_"$version"_linux_amd64.{tar.gz,deb}
mkdir -p ./dist
# build slim binaries
./scripts/build_go_slim.sh \
--output ./dist/ \
--compress 22 \
linux:amd64,armv7,arm64 \
windows:amd64,arm64 \
darwin:amd64,arm64

# build linux amd64 packages
./scripts/build_go_matrix.sh \
--output ./dist/ \
--package-linux \
linux:amd64 \
windows:amd64

- name: Install Release
run: |
gcloud config set project coder-dogfood
gcloud config set compute/zone us-central1-a
gcloud compute scp ./build/coder_*_linux_amd64.deb coder:/tmp/coder.deb
gcloud compute scp ./dist/coder_*_linux_amd64.deb coder:/tmp/coder.deb
gcloud compute ssh coder -- sudo dpkg -i --force-confdef /tmp/coder.deb
gcloud compute ssh coder -- sudo systemctl daemon-reload

Expand All @@ -525,9 +539,12 @@ jobs:
with:
name: coder
path: |
./build/*.zip
./build/*.tar.gz
./build/*.deb
./dist/*.zip
./dist/*.exe
./dist/*.tar.gz
./dist/*.apk
./dist/*.deb
./dist/*.rpm
retention-days: 7

test-js:
Expand Down
115 changes: 55 additions & 60 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,54 +65,52 @@ jobs:
restore-keys: |
js-${{ runner.os }}-

- name: Install protoc-gen-go
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
- name: Install protoc-gen-go-drpc
run: go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest

- name: Install Protoc
run: |
# protoc must be in lockstep with our dogfood Dockerfile
# or the version in the comments will differ.
set -x
cd dogfood
DOCKER_BUILDKIT=1 docker build . --target proto -t protoc
protoc_path=/usr/local/bin/protoc
docker run --rm --entrypoint cat protoc /tmp/bin/protoc > $protoc_path
chmod +x $protoc_path
protoc --version

- name: Install nfpm
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.16.0

- name: Install zstd
run: sudo apt-get install -y zstd

- name: Build Site
run: make site/out/index.html

- name: Build Linux and Windows Binaries
run: |
set -euo pipefail
go mod download

version="$(./scripts/version.sh)"
make -j \
-W coderd/database/querier.go \
build/coder_"$version"_linux_{amd64,armv7,arm64}.{tar.gz,apk,deb,rpm} \
build/coder_"$version"_windows_{amd64,arm64}.zip \
mkdir -p ./dist
# build slim binaries
./scripts/build_go_slim.sh \
--output ./dist/ \
--compress 22 \
linux:amd64,armv7,arm64 \
windows:amd64,arm64 \
darwin:amd64,arm64

# build linux and windows binaries
./scripts/build_go_matrix.sh \
--output ./dist/ \
--archive \
--package-linux \
linux:amd64,armv7,arm64 \
windows:amd64,arm64

- name: Build Linux Docker images
run: |
set -euxo pipefail

# build and (maybe) push Docker images for each architecture
version="$(./scripts/version.sh)"
push=""
if [[ "$CODER_RELEASE" == *t* ]]; then
push="push/"
fi
make -j \
"$push"build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
images=()
for arch in amd64 armv7 arm64; do
img="$(
./scripts/build_docker.sh \
${{ (!github.event.inputs.dry_run && !github.event.inputs.snapshot) && '--push' || '' }} \
--arch "$arch" \
./dist/coder_*_linux_"$arch"
)"
images+=("$img")
done

# we can't build multi-arch if the images aren't pushed, so quit now
# if dry-running
Expand All @@ -122,13 +120,14 @@ jobs:
fi

# build and push multi-arch manifest
make -j push/build/coder_"$version"_linux.tag
./scripts/build_docker_multiarch.sh \
--push \
"${images[@]}"

# if the current version is equal to the highest (according to semver)
# version in the repo, also create a multi-arch image as ":latest" and
# push it
if [[ "$(git tag | grep '^v' | grep -vE '(rc|dev|-|\+|\/)' | sort -r --version-sort | head -n1)" == "v$(./scripts/version.sh)" ]]; then
make -j push/build/coder_"$version"_linux.tag
./scripts/build_docker_multiarch.sh \
--push \
--target "$(./scripts/image_tag.sh --version latest)" \
Expand All @@ -140,11 +139,11 @@ jobs:
with:
name: linux
path: |
./build/*.zip
./build/*.tar.gz
./build/*.apk
./build/*.deb
./build/*.rpm
dist/*.zip
dist/*.tar.gz
dist/*.apk
dist/*.deb
dist/*.rpm

# The mac binaries get built on mac runners because they need to be signed,
# and the signing tool only runs on mac. This darwin job only builds the Mac
Expand Down Expand Up @@ -185,18 +184,6 @@ jobs:
restore-keys: |
js-${{ runner.os }}-

- name: Install protoc-gen-go
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
- name: Install protoc-gen-go-drpc
run: go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest

- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'

- name: Install dependencies
run: |
set -euo pipefail
Expand Down Expand Up @@ -226,11 +213,22 @@ jobs:
set -euo pipefail
go mod download

version="$(./scripts/version.sh)"
make -j \
build/coder_"$version"_darwin_{amd64,arm64}.zip
mkdir -p ./dist
# build slim binaries
./scripts/build_go_slim.sh \
--output ./dist/ \
--compress 22 \
linux:amd64,armv7,arm64 \
windows:amd64,arm64 \
darwin:amd64,arm64

# build darwin binaries
./scripts/build_go_matrix.sh \
--output ./dist/ \
--archive \
--sign-darwin \
darwin:amd64,arm64
env:
CODER_SIGN_DARWIN: "1"
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
AC_APPLICATION_IDENTITY: BDB050EB749EDD6A80C6F119BF1382ECA119CCCC
Expand All @@ -239,7 +237,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: darwin
path: ./build/*.zip
path: ./dist/coder_*.zip

publish:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -280,11 +278,8 @@ jobs:
- name: Publish Helm
run: |
set -euxo pipefail

version="$(./scripts/version.sh)"
make -j \
build/coder_helm_"$version".tgz
mv ./build/*.tgz ./artifacts/
./scripts/helm.sh --push
mv ./dist/*.tgz ./artifacts/

- name: Publish Release
run: |
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ site/**/*.typegen.ts
site/build-storybook.log

# Build
build/
dist/
site/out/

Expand Down
Loading