-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a script to repeatably generate
linux-arm64
and darwin-arm64
…
…builds (#380) * Simplify Builds * Copy out caching * Copy out caching * Safer rm * Use pnpm * Add ARM check
- Loading branch information
Showing
7 changed files
with
52 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM node:bullseye AS builder | ||
|
||
WORKDIR /workerd | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y curl clang libc++-dev libc++abi-dev | ||
|
||
COPY . . | ||
COPY .bazel-cache /bazel-disk-cache | ||
RUN npm install -g pnpm | ||
RUN pnpm install | ||
|
||
RUN pnpm exec bazelisk build --disk_cache=/bazel-disk-cache -c opt //src/workerd/server:workerd | ||
|
||
FROM scratch as artifact | ||
COPY --from=builder /workerd/bazel-bin/src/workerd/server/workerd /workerd-linux-arm64 | ||
COPY --from=builder /bazel-disk-cache /.bazel-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#! /bin/bash | ||
set -euo pipefail | ||
|
||
if [[ $(uname -m) == 'x86_64' ]]; then | ||
echo "This _must_ be run on an Apple Silicon machine, since the macOS ARM build cannot be dockerised due to macOS license restrictions" | ||
exit 1 | ||
fi | ||
|
||
rm -f workerd-darwin-arm64 | ||
rm -f workerd-linux-arm64 | ||
|
||
# Get the tag associated with the latest release, to ensure parity between binaries | ||
TAG_NAME=$(curl -sL https://api.github.com/repos/cloudflare/workerd/releases/latest | jq -r ".tag_name") | ||
|
||
git checkout $TAG_NAME | ||
|
||
# Build macOS binary | ||
pnpm exec bazelisk build --disk_cache=./.bazel-cache -c opt //src/workerd/server:workerd | ||
|
||
cp bazel-bin/src/workerd/server/workerd ./workerd-darwin-arm64 | ||
|
||
docker buildx build --platform linux/arm64 -f Dockerfile.release -t workerd:$TAG_NAME --target=artifact --output type=local,dest=$(pwd) . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.