From 0ad62f3de7348feeca1c65896b29e2af0062c26b Mon Sep 17 00:00:00 2001 From: Ben Lovy Date: Tue, 24 Feb 2026 23:58:46 -0500 Subject: [PATCH 1/6] feat(ci): add GitHub Actions workflows and fix action dependencies Add three CI workflows for self-hosted runners (aarch64-darwin, x86_64-linux, aarch64-linux): - pr.yaml: format check + test on pull requests - release.yaml: publish + release on push to main - manual.yaml: workflow_dispatch for ad-hoc test/publish/release All workflows use a shared composite action (.github/actions/setup-tangram) that configures /opt/tangram as the build directory with the staging remote, avoiding clashes with user ~/.tangram directories. Fix ACTION_DEPENDENCIES to match documented behavior: build now depends on check, and release now depends on test (not build directly). --- .github/actions/setup-tangram/action.yml | 35 +++++++++++++++++++++ .github/workflows/manual.yaml | 38 +++++++++++++++++++++++ .github/workflows/pr.yaml | 39 ++++++++++++++++++++++++ .github/workflows/release.yaml | 26 ++++++++++++++++ scripts/package_automation.ts | 4 +-- 5 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 .github/actions/setup-tangram/action.yml create mode 100644 .github/workflows/manual.yaml create mode 100644 .github/workflows/pr.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/actions/setup-tangram/action.yml b/.github/actions/setup-tangram/action.yml new file mode 100644 index 00000000..cbbeb12c --- /dev/null +++ b/.github/actions/setup-tangram/action.yml @@ -0,0 +1,35 @@ +name: Setup Tangram CI Directory +description: Configure /opt/tangram as the Tangram build directory for CI + +runs: + using: composite + steps: + - name: Create /opt/tangram directory + shell: bash + run: mkdir -p /opt/tangram/bin + + - name: Write config + shell: bash + run: | + cat > /opt/tangram/config.json <<'CONFIG' + { + "directory": "/opt/tangram", + "remotes": [{ + "name": "default", + "url": "https://staging.tangram.dev" + }] + } + CONFIG + + - name: Create tangram wrapper + shell: bash + run: | + cat > /opt/tangram/bin/tangram <<'WRAPPER' + #!/bin/sh + exec tangram --config /opt/tangram/config.json "$@" + WRAPPER + chmod +x /opt/tangram/bin/tangram + + - name: Set TG_EXE + shell: bash + run: echo "TG_EXE=/opt/tangram/bin/tangram" >> "$GITHUB_ENV" diff --git a/.github/workflows/manual.yaml b/.github/workflows/manual.yaml new file mode 100644 index 00000000..0ac8db8e --- /dev/null +++ b/.github/workflows/manual.yaml @@ -0,0 +1,38 @@ +name: Manual Dispatch + +on: + workflow_dispatch: + inputs: + packages: + description: Packages to process (space-separated) + required: true + type: string + action: + description: Action to run + required: true + type: choice + options: + - test + - publish + - release + +jobs: + run: + name: ${{ inputs.action }} (${{ matrix.platform }}) + runs-on: ${{ matrix.runner }} + environment: release + strategy: + matrix: + include: + - platform: aarch64-darwin + runner: [self-hosted, macOS, ARM64] + - platform: x86_64-linux + runner: [self-hosted, Linux, X64] + - platform: aarch64-linux + runner: [self-hosted, Linux, ARM64] + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + - uses: ./.github/actions/setup-tangram + - run: bun install --frozen-lockfile + - run: bun run auto --${{ inputs.action }} ${{ inputs.packages }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 00000000..0dc0e0f6 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,39 @@ +name: PR Validation + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + format: + name: Format Check + runs-on: [self-hosted, macOS, ARM64] + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + - uses: ./.github/actions/setup-tangram + - run: bun install --frozen-lockfile + - run: bun run auto --format + - name: Verify no formatting changes + run: git diff --exit-code + + test: + name: Test (${{ matrix.platform }}) + needs: format + runs-on: ${{ matrix.runner }} + environment: test + strategy: + matrix: + include: + - platform: aarch64-darwin + runner: [self-hosted, macOS, ARM64] + - platform: x86_64-linux + runner: [self-hosted, Linux, X64] + - platform: aarch64-linux + runner: [self-hosted, Linux, ARM64] + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + - uses: ./.github/actions/setup-tangram + - run: bun install --frozen-lockfile + - run: bun run auto --test diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..051db572 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,26 @@ +name: Release + +on: + push: + branches: [main] + +jobs: + release: + name: Release (${{ matrix.platform }}) + runs-on: ${{ matrix.runner }} + environment: release + strategy: + matrix: + include: + - platform: aarch64-darwin + runner: [self-hosted, macOS, ARM64] + - platform: x86_64-linux + runner: [self-hosted, Linux, X64] + - platform: aarch64-linux + runner: [self-hosted, Linux, ARM64] + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + - uses: ./.github/actions/setup-tangram + - run: bun install --frozen-lockfile + - run: bun run auto --publish --release diff --git a/scripts/package_automation.ts b/scripts/package_automation.ts index 57ece5da..5fac4375 100644 --- a/scripts/package_automation.ts +++ b/scripts/package_automation.ts @@ -759,10 +759,10 @@ const ACTION_ORDER = ["format", "check", "build", "test", "publish", "release"]; const ACTION_DEPENDENCIES: Record = { format: [], check: [], - build: [], + build: ["check"], test: ["build"], publish: [], - release: ["build", "publish"], + release: ["test", "publish"], }; type ActionFunction = (ctx: Context) => Promise>; From 364882bea9347fef5b78cdb446648091a53aa697 Mon Sep 17 00:00:00 2001 From: Ben Lovy Date: Wed, 25 Feb 2026 00:11:30 -0500 Subject: [PATCH 2/6] . --- scripts/package_automation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/package_automation.ts b/scripts/package_automation.ts index 5fac4375..57ece5da 100644 --- a/scripts/package_automation.ts +++ b/scripts/package_automation.ts @@ -759,10 +759,10 @@ const ACTION_ORDER = ["format", "check", "build", "test", "publish", "release"]; const ACTION_DEPENDENCIES: Record = { format: [], check: [], - build: ["check"], + build: [], test: ["build"], publish: [], - release: ["test", "publish"], + release: ["build", "publish"], }; type ActionFunction = (ctx: Context) => Promise>; From efd88785acf3f0281cf082cc6948d9fa3b489cc9 Mon Sep 17 00:00:00 2001 From: Ben Lovy Date: Wed, 25 Feb 2026 00:13:11 -0500 Subject: [PATCH 3/6] . --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 051db572..cb50c10f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -23,4 +23,4 @@ jobs: - uses: oven-sh/setup-bun@v2 - uses: ./.github/actions/setup-tangram - run: bun install --frozen-lockfile - - run: bun run auto --publish --release + - run: bun run auto --release From d945f0c5c96d89cc5bf727ff0a8f29e4659c5be9 Mon Sep 17 00:00:00 2001 From: Ben Lovy Date: Wed, 25 Feb 2026 00:28:20 -0500 Subject: [PATCH 4/6] no format --- .github/workflows/pr.yaml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 0dc0e0f6..76155c07 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -5,21 +5,8 @@ on: types: [opened, synchronize, reopened, ready_for_review] jobs: - format: - name: Format Check - runs-on: [self-hosted, macOS, ARM64] - steps: - - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v2 - - uses: ./.github/actions/setup-tangram - - run: bun install --frozen-lockfile - - run: bun run auto --format - - name: Verify no formatting changes - run: git diff --exit-code - test: name: Test (${{ matrix.platform }}) - needs: format runs-on: ${{ matrix.runner }} environment: test strategy: From 28dc53858adb21ca2221fdaeb6ddc916409c653c Mon Sep 17 00:00:00 2001 From: Ben Lovy Date: Wed, 25 Feb 2026 00:41:15 -0500 Subject: [PATCH 5/6] dont fail fast --- .github/workflows/manual.yaml | 1 + .github/workflows/pr.yaml | 1 + .github/workflows/release.yaml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/manual.yaml b/.github/workflows/manual.yaml index 0ac8db8e..027629d3 100644 --- a/.github/workflows/manual.yaml +++ b/.github/workflows/manual.yaml @@ -22,6 +22,7 @@ jobs: runs-on: ${{ matrix.runner }} environment: release strategy: + fail-fast: false matrix: include: - platform: aarch64-darwin diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 76155c07..bacd8673 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -10,6 +10,7 @@ jobs: runs-on: ${{ matrix.runner }} environment: test strategy: + fail-fast: false matrix: include: - platform: aarch64-darwin diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cb50c10f..5a8666ee 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,6 +10,7 @@ jobs: runs-on: ${{ matrix.runner }} environment: release strategy: + fail-fast: false matrix: include: - platform: aarch64-darwin From ccb7616df826e0b8a1130194fe18a3c3f6338a78 Mon Sep 17 00:00:00 2001 From: Ben Lovy Date: Wed, 25 Feb 2026 09:03:58 -0500 Subject: [PATCH 6/6] no manual, add format and check --- .github/workflows/manual.yaml | 39 ----------------------------------- .github/workflows/pr.yaml | 9 +++++++- 2 files changed, 8 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/manual.yaml diff --git a/.github/workflows/manual.yaml b/.github/workflows/manual.yaml deleted file mode 100644 index 027629d3..00000000 --- a/.github/workflows/manual.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: Manual Dispatch - -on: - workflow_dispatch: - inputs: - packages: - description: Packages to process (space-separated) - required: true - type: string - action: - description: Action to run - required: true - type: choice - options: - - test - - publish - - release - -jobs: - run: - name: ${{ inputs.action }} (${{ matrix.platform }}) - runs-on: ${{ matrix.runner }} - environment: release - strategy: - fail-fast: false - matrix: - include: - - platform: aarch64-darwin - runner: [self-hosted, macOS, ARM64] - - platform: x86_64-linux - runner: [self-hosted, Linux, X64] - - platform: aarch64-linux - runner: [self-hosted, Linux, ARM64] - steps: - - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v2 - - uses: ./.github/actions/setup-tangram - - run: bun install --frozen-lockfile - - run: bun run auto --${{ inputs.action }} ${{ inputs.packages }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index bacd8673..8853ee5e 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -24,4 +24,11 @@ jobs: - uses: oven-sh/setup-bun@v2 - uses: ./.github/actions/setup-tangram - run: bun install --frozen-lockfile - - run: bun run auto --test + - name: Verify formatting + run: | + bun run auto --format + git diff --exit-code + - name: Check + run: bun run auto --check + - name: Test + run: bun run auto --test --retry