name: PR Build on: pull_request_target: types: [labeled, synchronize] permissions: contents: read pull-requests: write jobs: build: if: contains(github.event.pull_request.labels.*.name, 'needs-build') runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 with: go-version: "1.26.x" cache: true - uses: goreleaser/goreleaser-action@5daf1e915a5f0af01ddbcd89a43b8061ff4f1a89 # v7 with: version: "~> v2" args: release --snapshot --clean --config .goreleaser-pr.yml - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: task_linux_amd64 path: dist/task_linux_amd64.tar.gz - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: task_linux_arm64 path: dist/task_linux_arm64.tar.gz - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: task_darwin_amd64 path: dist/task_darwin_amd64.tar.gz - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: task_darwin_arm64 path: dist/task_darwin_arm64.tar.gz - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: task_windows_amd64 path: dist/task_windows_amd64.zip - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: checksums path: dist/task_checksums.txt - uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0 id: find-comment with: token: ${{secrets.GITHUB_TOKEN}} issue-number: ${{ github.event.pull_request.number }} body-includes: "📦 Build artifacts ready!" - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 with: token: ${{secrets.GITHUB_TOKEN}} comment-id: ${{ steps.find-comment.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} body: | ## 📦 Build artifacts ready! Download binaries from [this workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}). Available platforms: Linux, macOS, Windows (amd64, arm64) edit-mode: replace