From 4d5398c3b0c67f80d2fd41d53d0981eecdf139cb Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Sun, 22 Nov 2026 14:00:44 -0300 Subject: [PATCH] build(tasks): take the common tasks from go-tools versions, bump, release, lint:workflows and consumers now come from go-tools' release, through one include, with the names and arguments they have in every spin-stack repository. go-tools moves to v0.20261122.5, the first module whose `go tool task` names that file and whose versions gate counts what its tasks read. The task that runs GoReleaser was named release, a name the include defines, and Task refuses a Taskfile that has both. It is release:artifacts now, after what it does. No workflow called it: release.yml runs GoReleaser through its action. The common release is taken without a gate, so it refuses. A release here is still release.yml's, dispatched: it runs e2e, the whole runtime matrix and publish parity on the commit before tagging it, and GoReleaser fills a draft a person publishes. Moving that onto the common task changes how the tool is released and is not done here. lint runs lint:workflows, so actionlint is pinned (v1.7.12, spin's) and .github/actionlint.yaml names the docker8 fleet's runner label, which actionlint otherwise reports as unknown. Part of spin-stack/go-tools#135 Co-Authored-By: Claude Fable 5.2 --- .github/actionlint.yaml | 5 +++++ Taskfile.yml | 17 ++++++++++++++--- go.mod | 2 +- go.sum | 4 ++-- versions.yaml | 18 ++++++++++++++---- 5 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 .github/actionlint.yaml diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 0000000..5e46f94 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,5 @@ +self-hosted-runner: + labels: + # spin-stack/ci's docker8 fleet, where the jobs that build and run containers land (go-cli.yml + # says why): an 8-vCPU EC2 instance per job. + - runs-on/fleet=docker8/env=production diff --git a/Taskfile.yml b/Taskfile.yml index 3acbb7f..fe1b449 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -27,6 +27,16 @@ vars: # What a release archive and the image carry beside the binary (.goreleaser.yml, Dockerfile). NOTICES: LICENSE.txt NOTICE THIRD_PARTY_NOTICES +includes: + # versions, bump, release, lint:workflows and consumers, as every spin-stack repository has them + # (go-tools' internal/tasks/tasks.yml). No GATE_WORKFLOW and GATE_JOBS, so release refuses: a + # release here is release.yml's, dispatched. It runs e2e, the whole runtime matrix and publish + # parity on the commit before it tags it, which no run of go-cli.yml on a push does, and + # GoReleaser then fills a draft that a person publishes once it has its archives. + common: + taskfile: "{{.GO_TOOLS_TASKS}}" + flatten: true + tasks: default: desc: Build and test the Go CLI @@ -200,10 +210,11 @@ tasks: - go test ./internal/cli -run TestE2E -count=1 -timeout 5m -v {{.CLI_ARGS}} lint: - desc: Run Go static checks and go-tools' gates - golangci-lint, goroutine lifetimes, tests that cannot fail, AGENTS.md's references, unreachable code, one task per workflow step, pnpm through Socket Firewall + desc: Run Go static checks and go-tools' gates - golangci-lint, the workflows (actionlint, actions pinned by commit), goroutine lifetimes, tests that cannot fail, AGENTS.md's references, unreachable code, one task per workflow step, pnpm through Socket Firewall cmds: - go vet ./cmd/... ./internal/... - task: lint:go + - task: lint:workflows - ctxlife - testquality -allow .github/testquality-allow.txt ./... - refs @@ -413,8 +424,8 @@ tasks: - rm -f {{.BINARY}} coverage.out coverage.html - rm -rf artifacts dist src/test/tmp - release: - desc: Run GoReleaser; pass --snapshot for a local release + release:artifacts: + desc: Build the release's archives, SBOMs and image with GoReleaser (-- --snapshot for a local build that publishes nothing) preconditions: - sh: command -v goreleaser >/dev/null msg: goreleaser is required diff --git a/go.mod b/go.mod index d44104d..60ce582 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/opencontainers/image-spec v1.1.1 github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.1.0 - github.com/spin-stack/go-tools v0.20261118.9 + github.com/spin-stack/go-tools v0.20261122.5 github.com/tailscale/hujson v0.0.0-20260727124030-b80ff77dac4f github.com/testcontainers/testcontainers-go v0.45.0 go.uber.org/mock v0.6.0 diff --git a/go.sum b/go.sum index 6c0bc50..39300c7 100644 --- a/go.sum +++ b/go.sum @@ -112,8 +112,8 @@ github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiT github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.1.0 h1:6W6MbVUrnMb8PEhjkqwsVLY7ryuzRfFHF4mQd7L94ag= github.com/spf13/pflag v1.1.0/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spin-stack/go-tools v0.20261118.9 h1:D8fNq3qR/m8E/Koy3K+vRlug6z3uW0yYhwf74AMkyYU= -github.com/spin-stack/go-tools v0.20261118.9/go.mod h1:Dz0i5ToXAyvGuFxMiSKu5pnH/gcA/k1WOX0FNmAt+GM= +github.com/spin-stack/go-tools v0.20261122.5 h1:KsHTqIpBGuCc2kyB+0xn6oU+QiiSerC3fuWRJ1KoesA= +github.com/spin-stack/go-tools v0.20261122.5/go.mod h1:E+Fw4T6GukPSmPlRNFT3OymrKnHzTGX1efcz1+l812c= github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= diff --git a/versions.yaml b/versions.yaml index 91f4112..9474ca4 100644 --- a/versions.yaml +++ b/versions.yaml @@ -1,5 +1,5 @@ -# Every input this repository pins, written once: `versions check` says what is behind, -# `versions bump ` moves one (go-tools' commands, on the PATH of `go tool task`), and internal/devtools/versions_gate_test.go fails on a +# Every input this repository pins, written once: `go tool task versions` says what is behind, +# `go tool task bump NAME=` moves one, and internal/devtools/versions_gate_test.go fails on a # pin written anywhere else. GitHub Actions are pinned by commit in the workflows; Dependabot # moves those, as go.sum is Go's. @@ -33,7 +33,7 @@ track: digest note: >- The released image's base (Dockerfile's DISTROLESS_IMAGE, handed to GoReleaser by task - release:env). A bump is checked by task release --snapshot and task release:smoke. + release:env). A bump is checked by task release:artifacts -- --snapshot and task release:smoke. - name: task kind: download @@ -56,4 +56,14 @@ track: github-release https://github.com/google/go-licenses note: >- task release:notices, which writes THIRD_PARTY_NOTICES for the release archives and image. - A bump is checked by task release:notices and the archive listing of task release --snapshot. + A bump is checked by task release:notices and by the archives task release:artifacts -- + --snapshot lists. + +- name: actionlint + kind: module + source: github.com/rhysd/actionlint/cmd/actionlint + version: v1.7.12 + track: github-release https://github.com/rhysd/actionlint + note: >- + task lint:workflows, which task lint runs. spin's version, so the spin-stack repositories' + workflows are read by the same linter.