diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 0000000000000000000000000000000000000000..a033e082bfc1a109f222f2ae9d57731f7b34318d --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,33 @@ +name: snapshot + +on: + push: + branches: + - main + +permissions: + contents: read + +concurrency: + group: snapshot-${{ github.ref }} + cancel-in-progress: true + +jobs: + snapshot: + runs-on: + # Use our own large runners with more CPU and RAM for faster builds + group: releasers + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + fetch-depth: 0 + persist-credentials: false + - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 + with: + go-version-file: go.mod + - uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0 + with: + version: "~> v2" + args: build --snapshot --clean + env: + GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} diff --git a/Taskfile.yaml b/Taskfile.yaml index 0043f4f033e455a5800da2431848e620c37a0f5a..b626c2fdd767d4da40b192de9e454fb8f2050afd 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -122,6 +122,10 @@ tasks: msg: Not on main branch - sh: "[ $(git status --porcelain=2 | wc -l) = 0 ]" msg: "Git is dirty" + - sh: 'gh run list --workflow build.yml --commit $(git rev-parse HEAD) --status success --json conclusion -q ".[0].conclusion" | grep -q success' + msg: "Test build for this commit failed or not present" + - sh: 'gh run list --workflow snapshot.yml --commit $(git rev-parse HEAD) --status success --json conclusion -q ".[0].conclusion" | grep -q success' + msg: "Snapshot build for this commit failed or not present" cmds: - task: fetch-tags - git commit --allow-empty -m "{{.NEXT}}"