Files
anomalyco__opentui/.github/workflows/pkg-pr-new.yml
T
Simon Klee 6dec16a77c native: move Zig sources into packages/native (#1391)
Separate the native implementation from the TypeScript bindings. Keep
core on
the public bindings and keep the current native artifact packages and
release
workflows.

packages/native owns the Zig source, tests, benches, and vendor updates.
The
package is private and unpublished for now Core still packages the
@opentui/core-* artifacts. build:native, test:native, and bench:native
still
work from core and delegate to native.

Expose a Zig import root and a no-JS hello example for proof of concept,
not a focus point, just a smoke test.
2026-08-20 11:34:03 +02:00

100 lines
2.8 KiB
YAML

name: Publish Preview Packages
on:
issue_comment:
types: [created]
permissions: {}
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
publish:
name: Publish Preview
if: |
github.event.issue.pull_request &&
github.event.issue.state == 'open' &&
(contains(github.event.comment.body, ' /pkg-preview') ||
startsWith(github.event.comment.body, '/pkg-preview')) &&
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
runs-on: blacksmith-12vcpu-macos-15
steps:
- name: Checkout PR branch
uses: actions/checkout@v6
with:
ref: refs/pull/${{ github.event.issue.number }}/head
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
use-cache: false
- name: Restore Zig cache
uses: actions/cache@v5
with:
path: packages/native/.zig-cache
key: zig-v1-${{ runner.os }}-0.16.0-${{ github.run_id }}-${{ github.job }}
restore-keys: zig-v1-${{ runner.os }}-0.16.0-
- name: Install dependencies
run: bun install
- name: Build core (all platforms via cross-compilation)
run: bun scripts/build.ts --native --all && bun scripts/build.ts --lib
working-directory: packages/core
- name: Build three
run: bun run build --ci
working-directory: packages/three
- name: Build qrcode
run: bun run build
working-directory: packages/qrcode
- name: Get native package directories
id: native-packages
run: |
NATIVE_DIRS=""
for dir in ./packages/core/node_modules/@opentui/core-*; do
if [ -d "$dir" ]; then
NATIVE_DIRS="${NATIVE_DIRS}${NATIVE_DIRS:+ }$dir"
fi
done
echo "dirs=$NATIVE_DIRS" >> $GITHUB_OUTPUT
echo "Found native packages: $NATIVE_DIRS"
- name: Build react
run: bun run build --ci
working-directory: packages/react
- name: Build solid
run: bun run build --ci
working-directory: packages/solid
- name: Build keymap
run: bun run build --ci
working-directory: packages/keymap
- name: Build ssh
run: bun run build
working-directory: packages/ssh
- name: Publish preview packages
run: |
npx pkg-pr-new publish --no-template --commentWithSha --bun \
'./packages/core/dist' \
${{ steps.native-packages.outputs.dirs }} \
'./packages/qrcode/dist' \
'./packages/three/dist' \
'./packages/react/dist' \
'./packages/solid/dist' \
'./packages/keymap/dist' \
'./packages/ssh/dist'