feat(parallel-agents): add parallel task execution with git worktrees #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Automated Release Workflow | |
| # Uses semantic-release for automated versioning and changelog generation | |
| # | |
| # Satisfies (release-automation manifold): | |
| # - B1: Version numbers follow semantic versioning | |
| # - B2: Every release has a changelog | |
| # - B3: Breaking changes increment MAJOR version | |
| # - B4: Releases traceable to commits | |
| # - T2: Version bump from commit types (fix→PATCH, feat→MINOR, BREAKING→MAJOR) | |
| # - T4: Release artifacts match tagged version | |
| # - T5: GitHub Action handles full release pipeline | |
| # - S1: Secrets not exposed in logs | |
| # - S2: Only GitHub Actions can create releases | |
| # - O1: Fully automated release process | |
| # - O2: Releases triggered on push to main only | |
| # - O4: Manual trigger available via workflow_dispatch | |
| # | |
| # Satisfies (original constraints): | |
| # - T1: CLI binaries for all 4 platforms | |
| # - T2: Binaries attached to GitHub release | |
| # - S2: Binaries built from tagged commit | |
| # - O3: Release tag matches CLI version | |
| name: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| description: 'Run semantic-release in dry-run mode' | |
| required: false | |
| default: 'false' | |
| type: boolean | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| # Satisfies: RT-2, RT-3, RT-4 (version calculation, changelog, release) | |
| semantic-release: | |
| name: Semantic Release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| new_release_published: ${{ steps.semantic.outputs.new_release_published }} | |
| new_release_version: ${{ steps.semantic.outputs.new_release_version }} | |
| new_release_git_tag: ${{ steps.semantic.outputs.new_release_git_tag }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install semantic-release | |
| run: | | |
| npm install -g semantic-release \ | |
| @semantic-release/changelog \ | |
| @semantic-release/git \ | |
| @semantic-release/github \ | |
| conventional-changelog-conventionalcommits | |
| - name: Run semantic-release | |
| id: semantic | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| if [ "${{ inputs.dry_run }}" = "true" ]; then | |
| echo "Running in dry-run mode..." | |
| npx semantic-release --dry-run | |
| else | |
| npx semantic-release | |
| fi | |
| build: | |
| name: Build CLI Binaries | |
| needs: semantic-release | |
| if: needs.semantic-release.outputs.new_release_published == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout tagged commit | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ needs.semantic-release.outputs.new_release_git_tag }} | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| working-directory: cli | |
| run: bun install | |
| - name: Run tests | |
| working-directory: cli | |
| run: bun test | |
| - name: Build binaries for all platforms | |
| working-directory: cli | |
| run: | | |
| mkdir -p dist | |
| echo "Building darwin-arm64..." | |
| bun build ./index.ts --compile --target=bun-darwin-arm64 --outfile ./dist/manifold-darwin-arm64 | |
| echo "Building darwin-x64..." | |
| bun build ./index.ts --compile --target=bun-darwin-x64 --outfile ./dist/manifold-darwin-x64 | |
| echo "Building linux-x64..." | |
| bun build ./index.ts --compile --target=bun-linux-x64 --outfile ./dist/manifold-linux-x64 | |
| echo "Building linux-arm64..." | |
| bun build ./index.ts --compile --target=bun-linux-arm64 --outfile ./dist/manifold-linux-arm64 | |
| echo "Build complete. Binary sizes:" | |
| ls -lh dist/ | |
| - name: Report binary sizes | |
| working-directory: cli | |
| run: | | |
| echo "Binary sizes (bun compile bundles full runtime):" | |
| for binary in dist/manifold-*; do | |
| size=$(stat -c%s "$binary" 2>/dev/null || stat -f%z "$binary") | |
| size_mb=$((size / 1024 / 1024)) | |
| echo " $binary: ${size_mb}MB" | |
| done | |
| - name: Upload binaries as artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cli-binaries | |
| path: cli/dist/manifold-* | |
| retention-days: 1 | |
| release: | |
| name: Upload Release Assets | |
| needs: [semantic-release, build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: cli-binaries | |
| path: binaries | |
| - name: Upload binaries to GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ needs.semantic-release.outputs.new_release_git_tag }} | |
| files: binaries/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| verify: | |
| name: Verify CLI Binary | |
| needs: [semantic-release, release] | |
| runs-on: ubuntu-latest | |
| # Don't fail the workflow if verification fails (assets may take time to propagate) | |
| continue-on-error: true | |
| steps: | |
| - name: Wait for release assets to propagate | |
| run: sleep 30 | |
| - name: Download and test CLI binary | |
| run: | | |
| VERSION="${{ needs.semantic-release.outputs.new_release_git_tag }}" | |
| BINARY_URL="https://github.com/dhanesh/manifold/releases/download/${VERSION}/manifold-linux-x64" | |
| echo "Downloading CLI from: $BINARY_URL" | |
| # Retry up to 3 times with 20 second delays | |
| for i in 1 2 3; do | |
| if curl -fsSL "$BINARY_URL" -o /tmp/manifold 2>/dev/null; then | |
| echo "Download successful on attempt $i" | |
| break | |
| fi | |
| echo "Attempt $i failed, retrying in 20s..." | |
| sleep 20 | |
| done | |
| if [ ! -f /tmp/manifold ]; then | |
| echo "WARNING: Could not download CLI binary after 3 attempts" | |
| echo "This may be a timing issue - release assets can take time to propagate" | |
| echo "Please verify manually at: https://github.com/dhanesh/manifold/releases/tag/${VERSION}" | |
| exit 0 | |
| fi | |
| chmod +x /tmp/manifold | |
| echo "Testing CLI..." | |
| /tmp/manifold --version | |
| /tmp/manifold --help | |
| echo "CLI binary verified successfully!" |