Merge pull request #4458 from brianmichel/brian/add-windows-arm-binary
Add Windows ARM64 Binary Output
This commit is contained in:
4
.github/workflows/build-binaries.yml
vendored
4
.github/workflows/build-binaries.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
- name: Setup Bun
|
- name: Setup Bun
|
||||||
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
|
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
|
||||||
with:
|
with:
|
||||||
bun-version: 1.2.20
|
bun-version: 1.3.10
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
||||||
@@ -69,6 +69,7 @@ jobs:
|
|||||||
pi-linux-x64.tar.gz \
|
pi-linux-x64.tar.gz \
|
||||||
pi-linux-arm64.tar.gz \
|
pi-linux-arm64.tar.gz \
|
||||||
pi-windows-x64.zip \
|
pi-windows-x64.zip \
|
||||||
|
pi-windows-arm64.zip \
|
||||||
2>/dev/null || \
|
2>/dev/null || \
|
||||||
gh release upload "${RELEASE_TAG}" \
|
gh release upload "${RELEASE_TAG}" \
|
||||||
pi-darwin-arm64.tar.gz \
|
pi-darwin-arm64.tar.gz \
|
||||||
@@ -76,4 +77,5 @@ jobs:
|
|||||||
pi-linux-x64.tar.gz \
|
pi-linux-x64.tar.gz \
|
||||||
pi-linux-arm64.tar.gz \
|
pi-linux-arm64.tar.gz \
|
||||||
pi-windows-x64.zip \
|
pi-windows-x64.zip \
|
||||||
|
pi-windows-arm64.zip \
|
||||||
--clobber
|
--clobber
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#
|
#
|
||||||
# Options:
|
# Options:
|
||||||
# --skip-deps Skip installing cross-platform dependencies
|
# --skip-deps Skip installing cross-platform dependencies
|
||||||
# --platform <name> Build only for specified platform (darwin-arm64, darwin-x64, linux-x64, linux-arm64, windows-x64)
|
# --platform <name> Build only for specified platform (darwin-arm64, darwin-x64, linux-x64, linux-arm64, windows-x64, windows-arm64)
|
||||||
#
|
#
|
||||||
# Output:
|
# Output:
|
||||||
# packages/coding-agent/binaries/
|
# packages/coding-agent/binaries/
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
# pi-linux-x64.tar.gz
|
# pi-linux-x64.tar.gz
|
||||||
# pi-linux-arm64.tar.gz
|
# pi-linux-arm64.tar.gz
|
||||||
# pi-windows-x64.zip
|
# pi-windows-x64.zip
|
||||||
|
# pi-windows-arm64.zip
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ if [[ -n "$PLATFORM" ]]; then
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Invalid platform: $PLATFORM"
|
echo "Invalid platform: $PLATFORM"
|
||||||
echo "Valid platforms: darwin-arm64, darwin-x64, linux-x64, linux-arm64, windows-x64"
|
echo "Valid platforms: darwin-arm64, darwin-x64, linux-x64, linux-arm64, windows-x64, windows-arm64"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -70,11 +71,13 @@ if [[ "$SKIP_DEPS" == "false" ]]; then
|
|||||||
@mariozechner/clipboard-linux-x64-gnu@0.3.0 \
|
@mariozechner/clipboard-linux-x64-gnu@0.3.0 \
|
||||||
@mariozechner/clipboard-linux-arm64-gnu@0.3.0 \
|
@mariozechner/clipboard-linux-arm64-gnu@0.3.0 \
|
||||||
@mariozechner/clipboard-win32-x64-msvc@0.3.0 \
|
@mariozechner/clipboard-win32-x64-msvc@0.3.0 \
|
||||||
|
@mariozechner/clipboard-win32-arm64-msvc@0.3.0 \
|
||||||
@img/sharp-darwin-arm64@0.34.5 \
|
@img/sharp-darwin-arm64@0.34.5 \
|
||||||
@img/sharp-darwin-x64@0.34.5 \
|
@img/sharp-darwin-x64@0.34.5 \
|
||||||
@img/sharp-linux-x64@0.34.5 \
|
@img/sharp-linux-x64@0.34.5 \
|
||||||
@img/sharp-linux-arm64@0.34.5 \
|
@img/sharp-linux-arm64@0.34.5 \
|
||||||
@img/sharp-win32-x64@0.34.5 \
|
@img/sharp-win32-x64@0.34.5 \
|
||||||
|
@img/sharp-win32-arm64@0.34.5 \
|
||||||
@img/sharp-libvips-darwin-arm64@1.2.4 \
|
@img/sharp-libvips-darwin-arm64@1.2.4 \
|
||||||
@img/sharp-libvips-darwin-x64@1.2.4 \
|
@img/sharp-libvips-darwin-x64@1.2.4 \
|
||||||
@img/sharp-libvips-linux-x64@1.2.4 \
|
@img/sharp-libvips-linux-x64@1.2.4 \
|
||||||
@@ -91,13 +94,13 @@ cd packages/coding-agent
|
|||||||
|
|
||||||
# Clean previous builds
|
# Clean previous builds
|
||||||
rm -rf binaries
|
rm -rf binaries
|
||||||
mkdir -p binaries/{darwin-arm64,darwin-x64,linux-x64,linux-arm64,windows-x64}
|
mkdir -p binaries/{darwin-arm64,darwin-x64,linux-x64,linux-arm64,windows-x64,windows-arm64}
|
||||||
|
|
||||||
# Determine which platforms to build
|
# Determine which platforms to build
|
||||||
if [[ -n "$PLATFORM" ]]; then
|
if [[ -n "$PLATFORM" ]]; then
|
||||||
PLATFORMS=("$PLATFORM")
|
PLATFORMS=("$PLATFORM")
|
||||||
else
|
else
|
||||||
PLATFORMS=(darwin-arm64 darwin-x64 linux-x64 linux-arm64 windows-x64)
|
PLATFORMS=(darwin-arm64 darwin-x64 linux-x64 linux-arm64 windows-x64 windows-arm64)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for platform in "${PLATFORMS[@]}"; do
|
for platform in "${PLATFORMS[@]}"; do
|
||||||
@@ -106,7 +109,7 @@ for platform in "${PLATFORMS[@]}"; do
|
|||||||
# into every binary. Koffi is only used on Windows for VT input and the
|
# into every binary. Koffi is only used on Windows for VT input and the
|
||||||
# call site has a try/catch fallback. For Windows builds, we copy the
|
# call site has a try/catch fallback. For Windows builds, we copy the
|
||||||
# appropriate .node file alongside the binary below.
|
# appropriate .node file alongside the binary below.
|
||||||
if [[ "$platform" == "windows-x64" ]]; then
|
if [[ "$platform" == windows-* ]]; then
|
||||||
bun build --compile --external koffi --target=bun-$platform ./dist/bun/cli.js --outfile binaries/$platform/pi.exe
|
bun build --compile --external koffi --target=bun-$platform ./dist/bun/cli.js --outfile binaries/$platform/pi.exe
|
||||||
else
|
else
|
||||||
bun build --compile --external koffi --target=bun-$platform ./dist/bun/cli.js --outfile binaries/$platform/pi
|
bun build --compile --external koffi --target=bun-$platform ./dist/bun/cli.js --outfile binaries/$platform/pi
|
||||||
@@ -130,11 +133,16 @@ for platform in "${PLATFORMS[@]}"; do
|
|||||||
cp -r examples binaries/$platform/
|
cp -r examples binaries/$platform/
|
||||||
|
|
||||||
# Copy koffi native module for Windows (needed for VT input support)
|
# Copy koffi native module for Windows (needed for VT input support)
|
||||||
if [[ "$platform" == "windows-x64" ]]; then
|
if [[ "$platform" == windows-* ]]; then
|
||||||
mkdir -p binaries/$platform/node_modules/koffi/build/koffi/win32_x64
|
if [[ "$platform" == "windows-arm64" ]]; then
|
||||||
|
koffi_arch_dir="win32_arm64"
|
||||||
|
else
|
||||||
|
koffi_arch_dir="win32_x64"
|
||||||
|
fi
|
||||||
|
mkdir -p binaries/$platform/node_modules/koffi/build/koffi/$koffi_arch_dir
|
||||||
cp ../../node_modules/koffi/index.js binaries/$platform/node_modules/koffi/
|
cp ../../node_modules/koffi/index.js binaries/$platform/node_modules/koffi/
|
||||||
cp ../../node_modules/koffi/package.json binaries/$platform/node_modules/koffi/
|
cp ../../node_modules/koffi/package.json binaries/$platform/node_modules/koffi/
|
||||||
cp ../../node_modules/koffi/build/koffi/win32_x64/koffi.node binaries/$platform/node_modules/koffi/build/koffi/win32_x64/
|
cp ../../node_modules/koffi/build/koffi/$koffi_arch_dir/koffi.node binaries/$platform/node_modules/koffi/build/koffi/$koffi_arch_dir/
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -142,7 +150,7 @@ done
|
|||||||
cd binaries
|
cd binaries
|
||||||
|
|
||||||
for platform in "${PLATFORMS[@]}"; do
|
for platform in "${PLATFORMS[@]}"; do
|
||||||
if [[ "$platform" == "windows-x64" ]]; then
|
if [[ "$platform" == windows-* ]]; then
|
||||||
# Windows (zip)
|
# Windows (zip)
|
||||||
echo "Creating pi-$platform.zip..."
|
echo "Creating pi-$platform.zip..."
|
||||||
(cd $platform && zip -r ../pi-$platform.zip .)
|
(cd $platform && zip -r ../pi-$platform.zip .)
|
||||||
@@ -157,7 +165,7 @@ done
|
|||||||
echo "==> Extracting archives for testing..."
|
echo "==> Extracting archives for testing..."
|
||||||
for platform in "${PLATFORMS[@]}"; do
|
for platform in "${PLATFORMS[@]}"; do
|
||||||
rm -rf $platform
|
rm -rf $platform
|
||||||
if [[ "$platform" == "windows-x64" ]]; then
|
if [[ "$platform" == windows-* ]]; then
|
||||||
mkdir -p $platform && (cd $platform && unzip -q ../pi-$platform.zip)
|
mkdir -p $platform && (cd $platform && unzip -q ../pi-$platform.zip)
|
||||||
else
|
else
|
||||||
tar -xzf pi-$platform.tar.gz && mv pi $platform
|
tar -xzf pi-$platform.tar.gz && mv pi $platform
|
||||||
|
|||||||
Reference in New Issue
Block a user