Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Build Packages

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to build and release'
required: true
type: number
push:
branches: ["main"]

env:
TANGRAM_CI_DIR: ${{ github.workspace }}/../.tangram-ci-${{ github.event.repository.name }}
TG_EXE: ${{ github.workspace }}/../.tangram-ci-${{ github.event.repository.name }}/bin/tangram

jobs:
test:
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- runner: [self-hosted, macOS, ARM64]
enabled: true
- runner: [self-hosted, Linux, X64]
enabled: false

steps:
- name: Check out packages repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/pull/{0}/head', github.event.inputs.pr_number) || github.ref }}

- name: Configure Tangram
run: |
mkdir -p "$TANGRAM_CI_DIR/bin"
cat > "$TANGRAM_CI_DIR/config.json" << 'EOF'
{}
EOF
cat > "$TANGRAM_CI_DIR/bin/tangram" << 'EOF'
#!/bin/sh
exec tangram --directory "$TANGRAM_CI_DIR" --config "$TANGRAM_CI_DIR/config.json" "$@"
EOF
chmod +x "$TANGRAM_CI_DIR/bin/tangram"

- name: Test packages
if: matrix.enabled
shell: bash
run: |
"$TG_EXE" server start
while [ "$("$TG_EXE" server status)" != "started" ]; do
sleep 1
done
bun run auto --test --sequential
"$TG_EXE" server stop

release:
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- runner: [self-hosted, macOS, ARM64]
enabled: true
- runner: [self-hosted, Linux, X64]
enabled: false

steps:
- name: Check out packages repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/pull/{0}/head', github.event.inputs.pr_number) || github.ref }}

- name: Configure Tangram
run: |
mkdir -p "$TANGRAM_CI_DIR/bin"
cat > "$TANGRAM_CI_DIR/config.json" << 'EOF'
{}
EOF
cat > "$TANGRAM_CI_DIR/bin/tangram" << 'EOF'
#!/bin/sh
exec tangram --directory "$TANGRAM_CI_DIR" --config "$TANGRAM_CI_DIR/config.json" "$@"
EOF
chmod +x "$TANGRAM_CI_DIR/bin/tangram"

- name: Release packages
if: matrix.enabled
shell: bash
run: |
"$TG_EXE" server start
while [ "$("$TG_EXE" server status)" != "started" ]; do
sleep 1
done
bun run auto --release --sequential
"$TG_EXE" server stop
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
tangram.lock
target
Claude.md
Loading