forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 13
/
release.sh
54 lines (41 loc) · 1.51 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
set -euxo pipefail
export DOCKER_BUILDKIT=1
export BUILDKIT_ARCH=$(uname -m)
export ARCH=${BUILDKIT_ARCH}
export LTO_FLAG="${LTO_FLAG:-""}"
if [ "$BUILDKIT_ARCH" == "amd64" ]; then
export BUILDKIT_ARCH="amd64"
export ARCH=x64
fi
if [ "$BUILDKIT_ARCH" == "x86_64" ]; then
export BUILDKIT_ARCH="amd64"
export ARCH=x64
fi
if [ "$BUILDKIT_ARCH" == "arm64" ]; then
export BUILDKIT_ARCH="arm64"
export ARCH=aarch64
fi
if [ "$BUILDKIT_ARCH" == "aarch64" ]; then
export BUILDKIT_ARCH="arm64"
export ARCH=aarch64
fi
if [ "$BUILDKIT_ARCH" == "armv7l" ]; then
echo "Unsupported platform: $BUILDKIT_ARCH"
exit 1
fi
export WEBKIT_RELEASE_TYPE=${WEBKIT_RELEASE_TYPE:-"Release"}
export CONTAINER_NAME=bun-webkit-linux-$BUILDKIT_ARCH
if [ "$WEBKIT_RELEASE_TYPE" == "relwithdebuginfo" ]; then
CONTAINER_NAME=bun-webkit-linux-$BUILDKIT_ARCH-dbg
fi
# If LTO is not enabled, we still need to be able to do a local release build.
# We use bullseye for CI to support older versions of glibc, but that requires libc++.
if [[ "$WEBKIT_RELEASE_TYPE" == "Debug" || "$LTO_FLAG" == "" ]]; then
export DEBIAN_VERSION="bookworm"
else
export DEBIAN_VERSION="bullseye"
fi
mkdir -p $temp
rm -rf $temp/bun-webkit
docker buildx build -f Dockerfile -t $CONTAINER_NAME --build-arg LTO_FLAG="$LTO_FLAG" --build-arg WEBKIT_RELEASE_TYPE=$WEBKIT_RELEASE_TYPE --build-arg DEBIAN_VERSION=$DEBIAN_VERSION --progress=plain --platform=linux/$BUILDKIT_ARCH --target=artifact --output type=local,dest=$temp/bun-webkit .