diff options
-rw-r--r-- | Dockerfile | 36 | ||||
-rw-r--r-- | Makefile | 13 | ||||
-rw-r--r-- | release.sh | 56 |
3 files changed, 84 insertions, 21 deletions
diff --git a/Dockerfile b/Dockerfile index 7d0d3bb58..d0ad0fece 100644 --- a/Dockerfile +++ b/Dockerfile @@ -72,23 +72,31 @@ RUN wget https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c cd icu/source && \ ./configure --enable-static --disable-shared && \ make -j$(nproc) && \ - cp lib/libicudata.a /home/ubuntu/bun/src/deps/libicudata.a && \ - cp lib/libicui18n.a /home/ubuntu/bun/src/deps/libicui18n.a && \ - cp lib/libicuio.a /home/ubuntu/bun/src/deps/libicuio.a && \ - cp lib/libicutu.a /home/ubuntu/bun/src/deps/libicutu.a && \ - cp lib/libicuuc.a /home/ubuntu/bun/src/deps/libicuuc.a + make install + ENV PATH "/home/ubuntu/zig:$PATH" ENV JSC_BASE_DIR $WEBKIT_OUT_DIR +ENV LIB_ICU_PATH /home/ubuntu/icu/source/lib WORKDIR /home/ubuntu/bun -RUN make api analytics node-fallbacks runtime_js fallback_decoder bun_error mimalloc picohttp zlib libarchive boringssl picohttp - -WORKDIR /home/ubuntu/bun - -RUN make jsc-bindings-headers -RUN make jsc-bindings-mac - -RUN make identifier-cache -RUN make release test-all
\ No newline at end of file +RUN mkdir -p /home/ubuntu/bun-release; \ + make \ + api \ + analytics \ + node-fallbacks \ + runtime_js \ + fallback_decoder \ + bun_error \ + mimalloc \ + zlib \ + libarchive \ + boringssl \ + picohttp \ + jsc-bindings-headers \ + jsc-bindings-mac \ + identifier-cache \ + release \ + test-all && \ + cp -r $(make release-bin-dir)/* /home/ubuntu/bun-release
\ No newline at end of file @@ -219,18 +219,15 @@ PLATFORM_LINKER_FLAGS = ifeq ($(OS_NAME), linux) PLATFORM_LINKER_FLAGS = \ + -fuse-ld=lld \ -lc \ -Wl,-z,now \ -Wl,--as-needed \ + -Wl,--gc-sections \ -Wl,-z,stack-size=12800000 \ - -Wl,-z,notext \ -ffunction-sections \ -fdata-sections \ - -Wl,--gc-sections \ - -stdlib=libstdc++ \ - -static-libstdc++ \ - -static-libgcc \ - -fPIC + -static-libstdc++ endif @@ -509,6 +506,7 @@ release-bin-generate: release-bin-generate-copy release-bin-generate-zip release-bin-check-version: test $(shell eval $(BUN_RELEASE_BIN) --version) = $(PACKAGE_JSON_VERSION) + test $(shell eval $(BUN_RELEASE_BIN) --dump-limits | jq .stack[0]) >= 1024024 release-bin-check: release-bin-check-version @@ -522,7 +520,8 @@ endif release-bin-without-push: test-all release-bin-check release-bin-generate release-bin-codesign release-bin: release-bin-without-push release-bin-push - +release-bin-dir: + echo $(PACKAGE_DIR) release-bin-push: diff --git a/release.sh b/release.sh new file mode 100644 index 000000000..bdd3d28f2 --- /dev/null +++ b/release.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +export DOCKER_BUILDKIT=1 + +export BUILDKIT_ARCH=$(uname -m) +export ARCH=${BUILDKIT_ARCH} + +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 BUILD_ID=$(cat build-id) +export CONTAINER_NAME=bun-linux-$ARCH + +temp=$(mktemp -d) + +docker build . -t $CONTAINER_NAME --progress=plain --platform=linux/$BUILDKIT_ARCH + +if (($?)); then + echo "Failed to build container" + exit 1 +fi + +id=$(docker create $CONTAINER_NAME:latest) +docker cp $id:/home/ubuntu/bun-release $temp/$CONTAINER_NAME +if (($?)); then + echo "Failed to cp container" + exit 1 +fi + +cd $temp && zip -r $CONTAINER_NAME.zip $CONTAINER_NAME +docker rm -v $id +docker tag $CONTAINER_NAME:latest ghcr.io/Jarred-Sumner/$CONTAINER_NAME:latest + |