From 17c63d880879ed0fa791b957d8520324d9462be1 Mon Sep 17 00:00:00 2001 From: Patrick Luan Date: Mon, 25 May 2026 13:17:31 -0300 Subject: [PATCH] build: add arm64 asset on release workflow and install.sh --- .github/workflows/release.yaml | 10 ++++++---- install.sh | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 86def97..1088e01 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -36,12 +36,14 @@ jobs: if: ${{ steps.release.outputs.release_created }} run: bun install - - name: Compile Binary (Linux) + - name: Compile Binaries (Linux x64 and ARM64) if: ${{ steps.release.outputs.release_created }} - run: bun build ./src/index.ts --compile --target=bun-linux-x64 --outfile jellycc-linux-x64 + run: | + bun build ./src/index.ts --compile --target=bun-linux-x64 --outfile jellycc-linux-x64 + bun build ./src/index.ts --compile --target=bun-linux-arm64 --outfile jellycc-linux-arm64 - - name: Upload Release Asset + - name: Upload Release Assets if: ${{ steps.release.outputs.release_created }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release upload ${{ steps.release.outputs.tag_name }} jellycc-linux-x64 \ No newline at end of file + run: gh release upload ${{ steps.release.outputs.tag_name }} jellycc-linux-x64 jellycc-linux-arm64 \ No newline at end of file diff --git a/install.sh b/install.sh index 373798c..1ae32bb 100755 --- a/install.sh +++ b/install.sh @@ -4,6 +4,19 @@ set -e echo "🚀 Starting JellyCC installation..." +# Detect OS architecture +ARCH=$(uname -m) +if [ "$ARCH" = "x86_64" ]; then + ASSET_ARCH="x64" +elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then + ASSET_ARCH="arm64" +else + echo "✖ Error: Unsupported architecture ($ARCH). JellyCC currently supports x86_64 and aarch64." + exit 1 +fi + +echo "🖥️ Detected architecture: $ARCH -> using asset jellycc-linux-$ASSET_ARCH" + # 1. Fetch the latest release version echo "🔍 Fetching the latest version..." LATEST_VERSION=$(curl -s https://api.github.com/repos/parkejunior/jellycc-cli/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') @@ -15,8 +28,8 @@ fi echo "📦 Found version: $LATEST_VERSION" -# 2. Define the download URL for the binary -BINARY_URL="https://github.com/parkejunior/jellycc-cli/releases/download/${LATEST_VERSION}/jellycc-linux-x64" +# 2. Define the download URL for the binary dynamically based on architecture +BINARY_URL="https://github.com/parkejunior/jellycc-cli/releases/download/${LATEST_VERSION}/jellycc-linux-${ASSET_ARCH}" # 3. Download the file to a temporary directory TMP_FILE="/tmp/jellycc"