Files
wehub-resource-sync 91e75e620b
CI: cua-driver distro-compat matrix / debian:12 (glibc 2.36) (push) Has been cancelled
CI: SPDX Headers / Check SPDX headers (warn-only) (push) Has been cancelled
CD: Docs MCP Server / build (linux/amd64) (push) Has been cancelled
CD: Docs MCP Server / build (linux/arm64) (push) Has been cancelled
CD: Docs MCP Server / merge (push) Has been cancelled
CI: cua-driver distro-compat matrix / Resolve release version (push) Has been cancelled
CI: cua-driver distro-compat matrix / fedora:41 (glibc 2.40) (push) Has been cancelled
CI: cua-driver distro-compat matrix / rockylinux:9 (glibc 2.34) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:22.04 (glibc 2.35) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:24.04 (glibc 2.39) (push) Has been cancelled
CI: cua-driver distro-compat matrix / Distro compat summary (push) Has been cancelled
CI: Rust Linux unit / Rust Linux unit and compile (push) Has been cancelled
CI: Rust Windows unit / Rust Windows unit and compile (push) Has been cancelled
CI: Nix Linux Rust source / Nix / compositor build (push) Has been cancelled
CI: Nix Linux Rust source / Nix / driver package (push) Has been cancelled
CI: Nix Linux Rust source / Nix / Rust unit tests (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:19 +08:00

67 lines
1.8 KiB
YAML

name: Reusable NPM Package Build Workflow
on:
workflow_call:
inputs:
package_name:
description: "Name of the package (e.g., cli, computer, core)"
required: true
type: string
package_dir:
description: "Directory containing the package relative to workspace root (e.g., libs/typescript/cua-cli)"
required: true
type: string
package_manager:
description: "Package manager to use (pnpm or bun)"
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: "24.x"
- name: Setup pnpm
if: inputs.package_manager == 'pnpm'
uses: pnpm/action-setup@v4
with:
package_json_file: ${{ inputs.package_dir }}/package.json
- name: Setup Bun
if: inputs.package_manager == 'bun'
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
working-directory: ./${{ inputs.package_dir }}
run: |
if [ "${{ inputs.package_manager }}" = "bun" ]; then
bun install --frozen-lockfile
else
pnpm install --frozen-lockfile
fi
- name: Build package
working-directory: ./${{ inputs.package_dir }}
run: |
if [ "${{ inputs.package_manager }}" = "bun" ]; then
if grep -q '"build"' package.json; then
bun run build
fi
else
pnpm run build --if-present
fi
- name: Verify build
working-directory: ./${{ inputs.package_dir }}
run: |
echo "Successfully built @trycua/${{ inputs.package_name }}"
ls -la