Skip to content

new github workflows #7

new github workflows

new github workflows #7

name: BAML Release - Build Typescript AArch64 GLIBC
on:
workflow_call: {}
workflow_dispatch: {}
push:
branches:
- sam/ts-release
concurrency:
# suffix is important to prevent a concurrency deadlock with the calling workflow
group: ${{ github.workflow }}-${{ github.ref }}-build-typescript-aarch64
cancel-in-progress: true
env:
DEBUG: napi:*
APP_NAME: baml
MACOSX_DEPLOYMENT_TARGET: "10.13"
# Turbo remote caching
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: gloo
jobs:
build:
strategy:
fail-fast: false
matrix:
_:
- target: aarch64-unknown-linux-gnu
# Do not use -latest, since it uses a different glibc version!
host: ubuntu-22.04-arm
# Use manylinux2014 aarch64 container to target older glibc (<2.33)
container: quay.io/pypa/manylinux2014_aarch64
node_build: pnpm build:napi-release --target aarch64-unknown-linux-gnu
cargo_args: -p baml-typescript-ffi -p baml-python-ffi
name: ${{ matrix._.target }}
runs-on: ${{ matrix._.host }}
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Checkout
uses: actions/checkout@v4
# Check GLIBC version for Linux targets (skip musl targets)
- name: Check GLIBC version
if: contains(matrix._.target, 'linux') && !contains(matrix._.target, 'musl')
run: |
ldd --version
- name: Check GLIBC version (manylinux_2_24 aarch64 container)
run: |
docker run --rm --platform=linux/arm64 quay.io/pypa/manylinux_2_24_aarch64 ldd --version
- name: Build inside manylinux_2_24 (aarch64)
env:
TARGET: ${{ matrix._.target }}
run: |
set -euo pipefail
docker run --rm --platform=linux/arm64 \
-e TARGET="$TARGET" \
-e TURBO_TOKEN="${TURBO_TOKEN:-}" \
-e TURBO_TEAM="${TURBO_TEAM:-}" \
-v "$PWD":/work \
-w /work \
quay.io/pypa/manylinux_2_24_aarch64 \
bash -lc '
set -euo pipefail
echo "--- GLIBC in container ---"
ldd --version
echo "--- Install prerequisites ---"
echo "deb http://archive.debian.org/debian stretch main" >/etc/apt/sources.list
echo "deb http://archive.debian.org/debian-security stretch/updates main" >>/etc/apt/sources.list
apt-get -o Acquire::Check-Valid-Until=false update -y
apt-get install -y curl git xz-utils build-essential python3 pkg-config ca-certificates
update-ca-certificates
echo "--- Install Rust toolchain ---"
curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.89.0
source "$HOME/.cargo/env"
rustup target add "$TARGET"
echo "--- Build Node.js from source (targets glibc 2.24) and install pnpm ---"
NODE_VERSION=20.17.0
curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz" | tar -xz
cd node-v${NODE_VERSION}
./configure --prefix=/opt/node
make -j"$(nproc)"
make install
export PATH=/opt/node/bin:$PATH
node -v
npm install -g pnpm@9.12.0
cd /work
echo "--- Install project dependencies ---"
cd engine/language_client_typescript
pnpm install --frozen-lockfile
echo "--- Build NAPI ---"
pnpm build:napi-release --target "$TARGET"
echo "--- Build TS ---"
pnpm build:ts_build
echo "--- Verify produced binaries ---"
ls -l *.node
ldd *.node
'
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix._.target }}
path: engine/language_client_typescript/*.node
if-no-files-found: error