chore(deps): bump github.com/charmbracelet/bubbles from 0.21.0 to 1.0.0 #88
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
| name: Build PR Artifacts | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| build-pr: | |
| name: Build PR Artifacts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.24' | |
| - name: Get PR info | |
| id: pr_info | |
| run: | | |
| echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT | |
| echo "SHORT_SHA=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT | |
| - name: Build test binaries | |
| run: | | |
| VERSION="pr-${{ steps.pr_info.outputs.PR_NUMBER }}-${{ steps.pr_info.outputs.SHORT_SHA }}" | |
| COMMIT_HASH=$(git rev-parse --short HEAD) | |
| BUILD_DATE=$(date -u '+%Y-%m-%dT%H:%M:%SZ') | |
| # Build for common platforms only for PRs | |
| GOOS=darwin GOARCH=arm64 go build -ldflags "-X github.com/kevinelliott/agentpipe/internal/version.Version=${VERSION} -X github.com/kevinelliott/agentpipe/internal/version.CommitHash=${COMMIT_HASH} -X github.com/kevinelliott/agentpipe/internal/version.BuildDate=${BUILD_DATE} -s -w" -o agentpipe_darwin_arm64 . | |
| GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/kevinelliott/agentpipe/internal/version.Version=${VERSION} -X github.com/kevinelliott/agentpipe/internal/version.CommitHash=${COMMIT_HASH} -X github.com/kevinelliott/agentpipe/internal/version.BuildDate=${BUILD_DATE} -s -w" -o agentpipe_linux_amd64 . | |
| GOOS=windows GOARCH=amd64 go build -ldflags "-X github.com/kevinelliott/agentpipe/internal/version.Version=${VERSION} -X github.com/kevinelliott/agentpipe/internal/version.CommitHash=${COMMIT_HASH} -X github.com/kevinelliott/agentpipe/internal/version.BuildDate=${BUILD_DATE} -s -w" -o agentpipe_windows_amd64.exe . | |
| # Create archives | |
| tar -czf agentpipe_darwin_arm64.tar.gz agentpipe_darwin_arm64 | |
| tar -czf agentpipe_linux_amd64.tar.gz agentpipe_linux_amd64 | |
| zip agentpipe_windows_amd64.zip agentpipe_windows_amd64.exe | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: pr-artifacts-${{ steps.pr_info.outputs.PR_NUMBER }} | |
| path: | | |
| *.tar.gz | |
| *.zip | |
| retention-days: 7 | |
| - name: Comment on PR | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const pr_number = ${{ steps.pr_info.outputs.PR_NUMBER }}; | |
| const short_sha = '${{ steps.pr_info.outputs.SHORT_SHA }}'; | |
| const run_url = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; | |
| const comment = `### 🔨 Build Artifacts Ready | |
| Test binaries for PR #${pr_number} (${short_sha}) have been built successfully! | |
| **Available platforms:** | |
| - 🍎 macOS (Apple Silicon) | |
| - 🐧 Linux (x64) | |
| - 🪟 Windows (x64) | |
| [Download artifacts from the workflow run](${run_url}) | |
| **Testing instructions:** | |
| \`\`\`bash | |
| # Download and extract the appropriate archive | |
| tar -xzf agentpipe_<platform>.tar.gz | |
| # or for Windows: unzip agentpipe_windows_amd64.zip | |
| # Test the binary | |
| ./agentpipe doctor | |
| ./agentpipe --help | |
| \`\`\``; | |
| // Find and update existing comment or create new one | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: pr_number, | |
| }); | |
| const botComment = comments.find(comment => | |
| comment.user.type === 'Bot' && | |
| comment.body.includes('Build Artifacts Ready') | |
| ); | |
| if (botComment) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: botComment.id, | |
| body: comment | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: pr_number, | |
| body: comment | |
| }); | |
| } |