From a3544b9c11f3a893c40dfef0cbddbaeb287a37a4 Mon Sep 17 00:00:00 2001 From: Jon Langevin Date: Sun, 3 May 2026 04:59:51 -0400 Subject: [PATCH] fix(release): remove top-level after: hook (broke goreleaser v2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #41 added a top-level `after:` hook to .goreleaser.yaml. goreleaser v2 has no top-level `after:` field — only `before:` exists. The release workflow for v0.9.0 (run 25274816649) failed instantly with `yaml: unmarshal errors: line 12: field after not found in type config.Project`. The previous `mv plugin.json.orig plugin.json` was theatre anyway: the GH Actions runner is ephemeral, so the in-place sed mutations to plugin.json are discarded when the runner shuts down. No need to restore plugin.json on the runner. Removed the matching `cp plugin.json plugin.json.orig` from the before block as well — it was preserving state nothing else reads. Validated with goreleaser/goreleaser:v2.15.4 check. Co-Authored-By: Claude Opus 4.7 (1M context) --- .goreleaser.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 51d6381..9b0ef7f 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -4,14 +4,19 @@ project_name: workflow-plugin-digitalocean before: hooks: - - cp plugin.json plugin.json.orig - "sed -i.bak 's/\"version\": \".*\"/\"version\": \"{{ .Version }}\"/' plugin.json && rm -f plugin.json.bak" - "sed -i.bak 's|/releases/download/v[^/]*/|/releases/download/{{ .Tag }}/|g' plugin.json && rm -f plugin.json.bak" - "export GOPRIVATE=github.com/GoCodeAlone/*; WFCTL_VERSION=$(go list -m github.com/GoCodeAlone/workflow | awk '{print $2}') && GOWORK=off go run github.com/GoCodeAlone/workflow/cmd/wfctl@${WFCTL_VERSION} plugin validate --file plugin.json --strict-contracts" -after: - hooks: - - mv plugin.json.orig plugin.json +# NOTE: removed top-level `after:` hook (introduced in #41). goreleaser +# v2 has no top-level `after:` hook — it failed v0.9.0's release at +# `yaml: unmarshal errors: line 12: field after not found in type +# config.Project`. The previous `mv plugin.json.orig plugin.json` was +# theatre — the GH Actions runner is ephemeral, so the in-place sed +# mutations to plugin.json are discarded the moment the runner shuts +# down. There is no need to restore plugin.json on the runner. Removed +# the matching `cp plugin.json plugin.json.orig` from the before block +# too — it was preserving state nothing else reads. builds: - id: workflow-plugin-digitalocean