Skip to content

does it work now

does it work now #13

name: Release language_client_typescript
on:
workflow_call: {}
push:
branches: [sam/alpine-builds]
concurrency:
# suffix is important to prevent a concurrency deadlock with the calling workflow
group: ${{ github.workflow }}-${{ github.ref }}-build-typescript
cancel-in-progress: true
env:
DEBUG: napi:*
APP_NAME: baml
MACOSX_DEPLOYMENT_TARGET: "10.13"
jobs:
build:
strategy:
fail-fast: false
matrix:
_:
# - target: aarch64-apple-darwin
# host: macos-14
# node_build: pnpm build:napi-release --target aarch64-apple-darwin
# baml_build_help: "off"
# # mise: true
# - target: aarch64-unknown-linux-gnu
# host: ubuntu-latest
# # from https://github.com/PyO3/maturin-action?tab=readme-ov-file#manylinux-docker-container
# # need a new version of manylinux to build crates on arm64-linux
# node_build: pnpm build:napi-release --target aarch64-unknown-linux-gnu --use-napi-cross
# cargo_args: -p baml-typescript-ffi -p baml-python-ffi
# baml_build_help: "off"
# - target: x86_64-apple-darwin
# host: macos-latest
# node_build: pnpm build:napi-release --target x86_64-apple-darwin
# baml_build_help: "off"
# # mise: true
# - target: x86_64-pc-windows-msvc
# host: windows-latest
# node_build: pnpm build:napi-release --target x86_64-pc-windows-msvc
# setup-python-architecture: x64
# cargo_args: -p baml-typescript-ffi -p baml-python-ffi
# baml_build_help: "off"
- target: x86_64-unknown-linux-gnu
host: ubuntu-latest
node_build: pnpm build:napi-release --target x86_64-unknown-linux-gnu --use-napi-cross
mise: true
- target: x86_64-unknown-linux-musl
host: ubuntu-latest
before: |
curl -LO https://musl.cc/x86_64-linux-musl-cross.tgz
tar -xzf x86_64-linux-musl-cross.tgz
echo "$PWD/x86_64-linux-musl-cross/bin" >> $GITHUB_PATH
# cat >>$GITHUB_ENV <<EOF
# CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc
# CXX_x86_64_unknown_linux_musl=x86_64-linux-musl-g++
# AR_x86_64_unknown_linux_musl=x86_64-linux-musl-ar
# CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=x86_64-linux-musl-cc
# EOF
node_build: env && pnpm build:napi-release --target x86_64-unknown-linux-musl --use-napi-cross
- target: aarch64-unknown-linux-musl
host: ubuntu-latest
before: |
curl -LO https://musl.cc/aarch64-linux-musl-cross.tgz
tar -xzf aarch64-linux-musl-cross.tgz
echo "$PWD/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH
node_build: pnpm build:napi-release --target aarch64-unknown-linux-musl --use-napi-cross
name: Build ${{ matrix._.target }}
runs-on: ${{ matrix._.host }}
env:
BAML_BUILD_HELP: ${{ matrix._.baml_build_help }}
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
if: ${{ matrix._.mise }}
- uses: pnpm/action-setup@v3
with:
version: 9.0.6
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: |
engine/language_client_typescript/pnpm-lock.yaml
# Install rust
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix._.target }}
# Install steps
- name: PNPM Install
run: pnpm install --frozen-lockfile
working-directory: engine/language_client_typescript
# Rust caching
- uses: Swatinem/rust-cache@v2
with:
workspaces: engine
shared-key: engine-${{ github.job }}-${{ matrix._.target }}
cache-on-failure: true
- name: Build tools setup
run: ${{ matrix._.before }}
# Build NAPI release
- name: PNPM Build
run: ${{ matrix._.node_build }}
working-directory: engine/language_client_typescript
# Build TS wrapper code and helpers as well
- name: Build TS
run: pnpm build:ts_build
working-directory: engine/language_client_typescript
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix._.target }}
path: engine/language_client_typescript/*.node
if-no-files-found: error