mirror of
https://github.com/go-task/task.git
synced 2026-02-24 03:59:52 +01:00
70 lines
2.2 KiB
YAML
70 lines
2.2 KiB
YAML
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@v6
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
fetch-depth: 0
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: '1.26.x'
|
|
cache: true
|
|
- uses: goreleaser/goreleaser-action@v7
|
|
with:
|
|
version: '~> v2'
|
|
args: release --snapshot --clean --config .goreleaser-pr.yml
|
|
- uses: actions/upload-artifact@v6
|
|
with:
|
|
name: task_linux_amd64
|
|
path: dist/task_linux_amd64.tar.gz
|
|
- uses: actions/upload-artifact@v6
|
|
with:
|
|
name: task_linux_arm64
|
|
path: dist/task_linux_arm64.tar.gz
|
|
- uses: actions/upload-artifact@v6
|
|
with:
|
|
name: task_darwin_amd64
|
|
path: dist/task_darwin_amd64.tar.gz
|
|
- uses: actions/upload-artifact@v6
|
|
with:
|
|
name: task_darwin_arm64
|
|
path: dist/task_darwin_arm64.tar.gz
|
|
- uses: actions/upload-artifact@v6
|
|
with:
|
|
name: task_windows_amd64
|
|
path: dist/task_windows_amd64.zip
|
|
- uses: actions/upload-artifact@v6
|
|
with:
|
|
name: checksums
|
|
path: dist/task_checksums.txt
|
|
- uses: peter-evans/find-comment@v4
|
|
id: find-comment
|
|
with:
|
|
token: ${{ secrets.GH_PAT || github.token }}
|
|
issue-number: ${{ github.event.pull_request.number }}
|
|
body-includes: '📦 Build artifacts ready!'
|
|
- uses: peter-evans/create-or-update-comment@v5
|
|
with:
|
|
token: ${{ secrets.GH_PAT || 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
|