From c6de8ef32512e582420f9f8a9ad65437367d11f3 Mon Sep 17 00:00:00 2001 From: lex00 <121451605+lex00@users.noreply.github.com> Date: Wed, 18 Nov 2026 14:12:05 -0700 Subject: [PATCH] chore: render the release workflow as publish.yml, chant 0.124.107 --- .github/workflows/{release.yml => publish.yml} | 16 ++++++++-------- Makefile | 2 +- RELEASING.md | 10 +++++----- chant.config.json | 2 +- justfile | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) rename .github/workflows/{release.yml => publish.yml} (91%) diff --git a/.github/workflows/release.yml b/.github/workflows/publish.yml similarity index 91% rename from .github/workflows/release.yml rename to .github/workflows/publish.yml index ea4ef35..c359d27 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/publish.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: label: - description: The release's label, such as v1.4.0, or auto for the one chant release next computes + description: The release's label, a bare version such as 1.4.0 since the tag template adds any v (one leading v is dropped), or auto for the one chant release next computes required: true type: string permissions: @@ -34,7 +34,7 @@ jobs: - id: green run: | commit="$GITHUB_SHA" - label="$CHANT_RELEASE_LABEL"; if [ "$label" = auto ]; then rc=0; git ls-remote --exit-code --heads origin chant/lifecycle >/dev/null || rc=$?; if [ "$rc" = 0 ]; then git fetch origin chant/lifecycle:chant/lifecycle; elif [ "$rc" != 2 ]; then exit "$rc"; fi; next="$(npx --yes @intentius/chant@0.124.105 release next --at "$commit" --json)" || { echo "release next found no label for $commit, so no release is cut: $next" >&2; exit 1; }; label="$(printf '%s' "$next" | node -e 'const f=process.argv[1];const t=f?require("fs").readFileSync(f,"utf8"):require("fs").readFileSync(0,"utf8");const d=JSON.parse(t);process.stdout.write(String(d.label??""))')"; fi + label="$CHANT_RELEASE_LABEL"; if [ "$label" = auto ]; then rc=0; git ls-remote --exit-code --heads origin chant/lifecycle >/dev/null || rc=$?; if [ "$rc" = 0 ]; then git fetch origin chant/lifecycle:chant/lifecycle; elif [ "$rc" != 2 ]; then exit "$rc"; fi; next="$(npx --yes @intentius/chant@0.124.107 release next --at "$commit" --json)" || { echo "release next found no label for $commit, so no release is cut: $next" >&2; exit 1; }; label="$(printf '%s' "$next" | node -e 'const f=process.argv[1];const t=f?require("fs").readFileSync(f,"utf8"):require("fs").readFileSync(0,"utf8");const d=JSON.parse(t);process.stdout.write(String(d.label??""))')"; fi echo "commit=$commit" >> "$GITHUB_OUTPUT" echo "label=$label" >> "$GITHUB_OUTPUT" cut: @@ -71,7 +71,7 @@ jobs: - uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0 with: platforms: "arm64" - - run: npx --yes @intentius/chant@0.124.105 release doctor --from cut + - run: npx --yes @intentius/chant@0.124.107 release doctor --from cut - name: goreleaser v2.19.0 run: "mkdir -p \"$RUNNER_TEMP/goreleaser\" && curl -fsSL -o \"$RUNNER_TEMP/goreleaser/goreleaser.tar.gz\" https://github.com/goreleaser/goreleaser/releases/download/v2.19.0/goreleaser_Linux_x86_64.tar.gz && echo \"ebc3194ad1d1b1787614405285a0039665cd4c5bd3305215a1b201600f90630b $RUNNER_TEMP/goreleaser/goreleaser.tar.gz\" | sha256sum -c - && tar -xzf \"$RUNNER_TEMP/goreleaser/goreleaser.tar.gz\" -C \"$RUNNER_TEMP/goreleaser\" goreleaser && echo \"CHANT_GORELEASER=$RUNNER_TEMP/goreleaser/goreleaser\" >> \"$GITHUB_ENV\"" - run: git fetch origin 'refs/tags/ci/*:refs/tags/ci/*' @@ -79,10 +79,10 @@ jobs: - run: | git config user.name "chant release" git config user.email "chant-release@localhost" - npx --yes @intentius/chant@0.124.105 release cut "$CHANT_RELEASE_LABEL" --at "$CHANT_RELEASE_COMMIT" --yes --json > "$RUNNER_TEMP/chant-cut.json" + npx --yes @intentius/chant@0.124.107 release cut "$CHANT_RELEASE_LABEL" --at "$CHANT_RELEASE_COMMIT" --yes --json > "$RUNNER_TEMP/chant-cut.json" tag="$(node -e 'const f=process.argv[1];const t=f?require("fs").readFileSync(f,"utf8"):require("fs").readFileSync(0,"utf8");const d=JSON.parse(t);process.stdout.write(String(d.tag?.name??""))' "$RUNNER_TEMP/chant-cut.json")" if [ -n "$tag" ]; then git push origin "refs/tags/$tag"; fi - - run: npx --yes @intentius/chant@0.124.105 release artifacts "$CHANT_RELEASE_LABEL" --no-build -o "$RUNNER_TEMP/chant-release-artifacts" + - run: npx --yes @intentius/chant@0.124.107 release artifacts "$CHANT_RELEASE_LABEL" --no-build -o "$RUNNER_TEMP/chant-release-artifacts" - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: chant-release-artifacts @@ -132,11 +132,11 @@ jobs: with: name: chant-release-images path: build/images - - run: npx --yes @intentius/chant@0.124.105 release images "$CHANT_RELEASE_LABEL" --no-build -o "$RUNNER_TEMP/chant-release-digests.json" + - run: npx --yes @intentius/chant@0.124.107 release images "$CHANT_RELEASE_LABEL" --no-build -o "$RUNNER_TEMP/chant-release-digests.json" - run: echo "CHANT_RELEASE_DIGESTS=$RUNNER_TEMP/chant-release-digests.json" >> "$GITHUB_ENV" - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: chant-release-artifacts path: ${{ runner.temp }}/chant-release-artifacts - - run: npx --yes @intentius/chant@0.124.105 release artifacts "$CHANT_RELEASE_LABEL" --from "$RUNNER_TEMP/chant-release-artifacts" - - run: npx --yes @intentius/chant@0.124.105 release publish "$CHANT_RELEASE_LABEL" --yes + - run: npx --yes @intentius/chant@0.124.107 release artifacts "$CHANT_RELEASE_LABEL" --from "$RUNNER_TEMP/chant-release-artifacts" + - run: npx --yes @intentius/chant@0.124.107 release publish "$CHANT_RELEASE_LABEL" --yes diff --git a/Makefile b/Makefile index bcff425..e9dcf5d 100644 --- a/Makefile +++ b/Makefile @@ -53,4 +53,4 @@ release: git pull --ff-only origin main @grep -q "## \[$(V)\]" CHANGELOG.md || { echo "CHANGELOG.md has no '## [$(V)]' section"; exit 1; } go build ./... && go vet ./... && test -z "$$(gofmt -l .)" && go test ./... - gh workflow run release.yml --repo INTENTIUS/mudflaps --ref main -f label=$(V) + gh workflow run publish.yml --repo INTENTIUS/mudflaps --ref main -f label=$(V) diff --git a/RELEASING.md b/RELEASING.md index b2c2fa6..24ea0ec 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,7 +1,7 @@ # Releasing mudflaps releases with [`chant release`](https://intentius.io/chant/cli/release/). -A release is started by hand: the [Release workflow](.github/workflows/release.yml) +A release is started by hand: the [Release workflow](.github/workflows/publish.yml) picks the newest green commit of `main`, cuts it as `vX.Y.Z`, and publishes: - a GitHub Release `vX.Y.Z` with the GoReleaser archives for linux, darwin and @@ -17,10 +17,10 @@ file by digest, and pushes the tag. The publish job then uploads exactly those files and that image. Tags stay `vX.Y.Z`; the `v*` tags from before chant are read as the release history. -`release.yml` is generated: change `chant.config.json`, then regenerate it with +`publish.yml` is generated: change `chant.config.json`, then regenerate it with ```sh -npx --yes @intentius/chant@0.124.105 release workflow --force +npx --yes @intentius/chant@0.124.107 release workflow --force ``` ## Steps @@ -32,7 +32,7 @@ npx --yes @intentius/chant@0.124.105 release workflow --force 2. **Check the label** (optional). From a clean, up-to-date `main`: ```sh - npx --yes @intentius/chant@0.124.105 release next # the label the commits give + npx --yes @intentius/chant@0.124.107 release next # the label the commits give ``` 3. **Start the release:** @@ -44,7 +44,7 @@ npx --yes @intentius/chant@0.124.105 release workflow --force The recipe refuses to proceed unless the working tree is clean, you are on `main`, the changelog has a `## [X.Y.Z]` section, and `build`/`vet`/`gofmt`/ `test` all pass. It then dispatches the Release workflow with the label - `X.Y.Z`. `gh workflow run release.yml -f label=auto` takes the label from the + `X.Y.Z`. `gh workflow run publish.yml -f label=auto` takes the label from the commits instead. 4. **Watch the release build:** diff --git a/chant.config.json b/chant.config.json index 53ecc0b..15f386c 100644 --- a/chant.config.json +++ b/chant.config.json @@ -57,7 +57,7 @@ ], "workflow": { "trigger": "dispatch", - "file": ".github/workflows/release.yml" + "file": ".github/workflows/publish.yml" } } } diff --git a/justfile b/justfile index 3b018cd..42113d8 100644 --- a/justfile +++ b/justfile @@ -74,6 +74,6 @@ release version: [ -z "$(gofmt -l .)" ] || { echo "✗ gofmt reported files"; exit 1; } go test ./... echo "→ dispatching the Release workflow for {{version}}" - gh workflow run release.yml --repo INTENTIUS/mudflaps --ref main -f label={{version}} + gh workflow run publish.yml --repo INTENTIUS/mudflaps --ref main -f label={{version}} echo "✓ dispatched; chant cuts v{{version}} from the newest green commit of main and publishes it." echo " watch: gh run watch --repo INTENTIUS/mudflaps"