forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrelease.sh
65 lines (49 loc) · 1.55 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
55
56
57
58
59
60
61
62
63
64
65
#!/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
export DEBIAN_VERSION="bookworm"
export temp=${temp:-"$(mktemp -d -t bun-webkit-linux-$BUILDKIT_ARCH-release-$(date +%s)-XXXX)"}
mkdir -p $temp
rm -rf $temp/bun-webkit
echo "Building $CONTAINER_NAME to $temp/bun-webkit"
docker buildx build \
-f Dockerfile \
-t $CONTAINER_NAME \
--build-arg LTO_FLAG="$LTO_FLAG" \
--build-arg RELEASE_FLAGS="$RELEASE_FLAGS" \
--build-arg WEBKIT_RELEASE_TYPE=$WEBKIT_RELEASE_TYPE \
--build-arg RELEASE_FLAGS="${RELEASE_FLAGS:-"-O2 -DNDEBUG=1"}" \
--progress=plain \
--platform=linux/$BUILDKIT_ARCH \
--target=artifact \
--output type=local,dest=$temp/bun-webkit \
.
echo "Successfully built $CONTAINER_NAME to $temp/bun-webkit"