aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-id2
-rw-r--r--release.sh56
-rw-r--r--run-dockerfile.sh71
3 files changed, 72 insertions, 57 deletions
diff --git a/build-id b/build-id
index 8c61d23e1..04f9fe460 100644
--- a/build-id
+++ b/build-id
@@ -1 +1 @@
-58
+59
diff --git a/release.sh b/release.sh
deleted file mode 100644
index bdd3d28f2..000000000
--- a/release.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/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
-
diff --git a/run-dockerfile.sh b/run-dockerfile.sh
new file mode 100644
index 000000000..63fbb04da
--- /dev/null
+++ b/run-dockerfile.sh
@@ -0,0 +1,71 @@
+#!/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
+export DEBUG_CONTAINER_NAME=debug-bun-linux-$ARCH
+export TEMP=/tmp/bun-0.0.$BUILD_ID
+rm -rf $TEMP
+mkdir -p $TEMP
+
+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
+mkdir -p $TEMP/$CONTAINER_NAME $TEMP/$DEBUG_CONTAINER_NAME
+mv $CONTAINER_NAME/bun-profile $DEBUG_CONTAINER_NAME/bun
+zip -r $CONTAINER_NAME.zip $CONTAINER_NAME
+zip -r $DEBUG_CONTAINER_NAME.zip $DEBUG_CONTAINER_NAME
+docker rm -v $id
+docker tag $CONTAINER_NAME:latest ghcr.io/jarred-sumner/$CONTAINER_NAME:latest
+abs=$(realpath $TEMP/$CONTAINER_NAME.zip)
+debug_abs=$(realpath $TEMP/$DEBUG_CONTAINER_NAME.zip)
+
+if command -v bun --version >/dev/null; then
+ cp $TEMP/$CONTAINER_NAME/bun $(which bun)
+ cp $TEMP/$DEBUG_CONTAINER_NAME/bun $(which bun-profile)
+fi
+
+echo "Saved to:"
+echo $debug_abs
+echo $abs