Skip to content

ci: replace knope with release-plz - #57

Merged
BatmanAoD merged 22 commits into
mainfrom
adopt-release-plz
Nov 13, 2026
Merged

BatmanAoD merged 22 commits into
mainfrom
adopt-release-plz

Conversation

@BatmanAoD

@BatmanAoD BatmanAoD commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Replaces knope and the shared release workflows with release-plz, using only GITHUB_TOKEN. release-plz was chosen because it looks like a popular and idiomatic choice for Rust, but it has no support for other languages, so we will need to use something else in a few cases.

Releases go through a release PR, opened only by a manual dispatch; merging it releases.

(PR was heavily Claude-assisted)

BatmanAoD added a commit that referenced this pull request Nov 12, 2026
Restore `prepare-prerelease.yml` to `main` and the version (0.1.18) and
changelog to their state before the release candidates. The release
workflow changes now live in #57.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
@BatmanAoD
BatmanAoD changed the base branch from main to support-gl-job-token November 12, 2026 18:43
Base automatically changed from support-gl-job-token to main November 12, 2026 22:41
BatmanAoD added a commit that referenced this pull request Nov 12, 2026
* feat: support GitLab job-token

* temporary: let GitLab integration-tests fail

* chore(ci): reference #55 from the temporary GitLab exemption

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv

* fix: use a single rustls crypto provider

`gitlab` 0.1905 pulls in `reqwest` with `aws-lc-rs`,
while `octocrab` enabled `ring` by default.
With both enabled, `rustls` cannot pick a default provider and panics.
Select `aws-lc-rs` for `octocrab` so only one provider remains.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv

* tear out all remaining uses of the GitLab CI token

* explicit non-job token-type with `CI_JOB_TOKEN` is an explicit error

* ci: prerelease without RELEASE_TOKEN, dispatching CI explicitly

Fall back to `GITHUB_TOKEN` when `RELEASE_TOKEN` is unset.
Pushes made with it start no workflows, but `workflow_dispatch` is exempt,
so a follow-up job dispatches `ci.yml` on the prerelease branch.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv

* ci: inline the prerelease to test it with only GITHUB_TOKEN

The shared rust-cli-prerelease.yml never received a fallback token
through `secrets:`, and its draft job caps GITHUB_TOKEN at
`contents: read`. Inline it here to find out what works first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv

* chore: prepare release 0.1.19-rc.0

* ci: build the prerelease on macos-latest

GitHub rejects `macos-14` here as an unsupported configuration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv

* chore: prepare release 0.1.19-rc.1

* revert: drop the prerelease experiment from this branch

Restore `prepare-prerelease.yml` to `main` and the version (0.1.18) and
changelog to their state before the release candidates. The release
workflow changes now live in #57.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv

* refactor: read GitLab token and auth scheme together

Replace `gitlab_token`, `explicit_gitlab_token` and `gitlab_auth_kind`
with `GitlabAuth::from_env`, which returns the token and its scheme,
or `None` without a token.
`GitlabAuth::configure` selects the scheme on the client builder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv

* refactor: have `GitlabAuth` build the GitLab client

`GitlabAuth::build` returns a client configured with the token and its
scheme, replacing `configure`, which only selected the scheme on a
builder created elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv

* refactor: hold tokens in `SecretString`

Wrap the GitHub and GitLab tokens in `secrecy::SecretString`,
so `Debug` output redacts them.
The GitLab token is exposed only to build the client,
since `gitlab` takes it as a plain `String`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv

* don't name var explicitly

* error message tweaks

Co-authored-by: Graham Smith <197960048+gsmith-rigetti@users.noreply.github.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Graham Smith <197960048+gsmith-rigetti@users.noreply.github.com>
BatmanAoD and others added 14 commits November 12, 2026 17:17
Open a release PR on pushes to `main`; merging it tags, builds, and
publishes the release from a single workflow, using only `GITHUB_TOKEN`.
The release stays a draft until its binaries are attached.
Prereleases tag a commit on no branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
It lets consumers use a version of the tool that includes unmerged work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
Replace the push-triggered release flow with three `workflow_dispatch`
workflows: prepare-release, release, and prepare-prerelease.
Validate tags and labels, make release and prerelease re-runnable, widen
`release_commits` to any breaking change, fix the changelog spacing, and
set `publish = false`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
Make close and reopen the primary step for the release PR checks, and
document that squash and rebase merges tag `main` at dispatch time.
Refuse a prerelease version in `release.yml`, pass `--prerelease` in its
fallback, validate the prerelease tag before pushing, serialize prerelease
dispatches per branch, and fail with an accurate message when `Cargo.toml`
is ahead of the latest release tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
Drop `release_commits`, the `[changelog]` block, and `git_tag_name`; the
defaults tag `vX.Y.Z` and release on any change to a packaged file.
Seed `CHANGELOG.md` with the default header, read release notes from either
heading format, and reword the prerelease "no bump" message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
A PR opened or updated with `GITHUB_TOKEN` gets `pull_request` runs
held in `action_required`, verified in a public scratch repository
with this repository's Actions settings.
Approving them is the primary step; close and reopen is the fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
Keep only what `build` and `publish` need: the tag, whether it exists,
and a clear failure when the tag or release is missing.
Drop the early refusal of a published or prerelease version,
the ancestor check, and the fallback that created a missing release;
`publish` still refuses to modify a release that is not a draft.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
`release-plz/action` runs only `release-pr` or `release`,
and the prerelease needs `release-plz update`.
install-action verifies the download against its manifest's SHA-256.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
`set-version` also renames the newest `CHANGELOG.md` heading,
so the changelog is restored afterwards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
The commit exists only under the prerelease tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
Cargo rejects a `Cargo.toml` version that is not valid semver,
and `release-plz set-version` rejects an invalid prerelease version;
every tag comes from one of those.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
BatmanAoD and others added 4 commits November 12, 2026 17:18
`build-release.yml` builds the binaries from a tag, attaches them to its
draft release, and undrafts it.
The prerelease now creates its draft before calling it, as release-plz
does for a release, and re-running against a published prerelease fails
instead of doing nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
`release.yml` runs on a merged `release`-labeled PR into `main`,
from the PR's merge commit, so any merge method releases exactly what
the release PR covered.
A dispatch on `main` remains for recovery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
Publishing stays local: the shared publish workflow runs knope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
`release-plz set-version` rejects a version that is not valid semver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
Comment thread .github/workflows/prepare-release.yml Resolved
Comment thread .github/workflows/prepare-release.yml Resolved
Comment thread README.md Resolved
Comment thread .github/workflows/prepare-release.yml Resolved
Comment thread Cargo.toml Resolved
Co-authored-by: Kyle J Strand <BatmanAoD@users.noreply.github.com>
Drops the separate tag computation and the existing-tag path:
a failed build or publish is recovered with "Re-run failed jobs",
which keeps the `release` job's outputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3mkz6m3aZBokQhgvfjnSv
Comment thread CHANGELOG.md Resolved
@BatmanAoD
BatmanAoD marked this pull request as ready for review November 13, 2026 00:47
@BatmanAoD
BatmanAoD enabled auto-merge (squash) November 13, 2026 01:03
Comment thread README.md Resolved
Comment thread Cargo.toml Resolved
Comment thread .github/workflows/build-release.yml Resolved
Co-authored-by: Michael Bryant <shadow53@shadow53.com>
@BatmanAoD
BatmanAoD requested a review from Shadow53 November 13, 2026 04:01
@BatmanAoD
BatmanAoD merged commit deee863 into main Nov 13, 2026
7 checks passed
@BatmanAoD
BatmanAoD deleted the adopt-release-plz branch November 13, 2026 17:10
@github-actions github-actions Bot mentioned this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants