diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..5c3ec25b --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,92 @@ +name: Build Packages + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + push: + branches: ["main"] + +jobs: + test: + if: github.event_name == 'pull_request' + runs-on: ${{ matrix.runner }} + environment: test + strategy: + fail-fast: false + matrix: + include: + - runner: [self-hosted, macOS, ARM64] + enabled: true + - runner: [self-hosted, Linux, X64] + enabled: true + + steps: + - name: Check out packages repository + uses: actions/checkout@v4 + + - name: Set environment variables + run: | + echo "TANGRAM_CI_DIR=$HOME/.tangram-ci" >> $GITHUB_ENV + echo "TG_EXE=$HOME/.tangram-ci/bin/tangram" >> $GITHUB_ENV + + - name: Configure Tangram + run: | + mkdir -p "$TANGRAM_CI_DIR/bin" + cat > "$TANGRAM_CI_DIR/config.json" << 'EOF' + { + "remotes": [] + } + EOF + cat > "$TANGRAM_CI_DIR/bin/tangram" << 'EOF' + #!/bin/sh + exec tangram --directory "$TANGRAM_CI_DIR/.tangram" --config "$TANGRAM_CI_DIR/config.json" "$@" + EOF + chmod +x "$TANGRAM_CI_DIR/bin/tangram" + + - name: Test packages + if: matrix.enabled + shell: bash + run: | + bun run auto --test --sequential + + release: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ${{ matrix.runner }} + environment: release + strategy: + fail-fast: false + matrix: + include: + - runner: [self-hosted, macOS, ARM64] + enabled: true + - runner: [self-hosted, Linux, X64] + enabled: true + + steps: + - name: Check out packages repository + uses: actions/checkout@v4 + + - name: Set environment variables + run: | + echo "TANGRAM_CI_DIR=$HOME/.tangram-ci" >> $GITHUB_ENV + echo "TG_EXE=$HOME/.tangram-ci/bin/tangram" >> $GITHUB_ENV + + - name: Configure Tangram + run: | + mkdir -p "$TANGRAM_CI_DIR/bin" + cat > "$TANGRAM_CI_DIR/config.json" << 'EOF' + { + "remotes": [] + } + EOF + cat > "$TANGRAM_CI_DIR/bin/tangram" << 'EOF' + #!/bin/sh + exec tangram --directory "$TANGRAM_CI_DIR/.tangram" --config "$TANGRAM_CI_DIR/config.json" "$@" + EOF + chmod +x "$TANGRAM_CI_DIR/bin/tangram" + + - name: Release packages + if: matrix.enabled + shell: bash + run: | + bun run auto --release --sequential diff --git a/.gitignore b/.gitignore index c291c9fd..e1ddf8b1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules tangram.lock target +Claude.md