Skip to content

feat(ENG-15913): pin and auto-bump the CLI release in the cloudsmith-cli kit - #5

Draft
cloudsmith-iduffy wants to merge 5 commits into
mainfrom
eng-15913
Draft

cloudsmith-iduffy wants to merge 5 commits into
mainfrom
eng-15913

Conversation

@cloudsmith-iduffy

@cloudsmith-iduffy cloudsmith-iduffy commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Sandboxes that use the cloudsmith-cli kit's default CLI version now get an exact CLI release, and stay on CLI 1.x when CLI 2.0.0 ships. A bot moves the pin to each new 1.x release. cloudsmith-io/cloudsmith-cli-action uses the same flow.

This PR sets the kit's cli-version default to 1.31.3, the current CLI release, and releases the kit as 0.1.1. latest is still accepted. The kit README and the new cloudsmith-cli/CHANGELOG.md describe the change.

CLI 1.31.4 ships

  1. The CLI release sends the cloudsmith-cli-release event to this repository (feat(ENG-15913): add a release channel for each major version cloudsmith-cli#627).
  2. bump-cli-version.yml runs scripts/bump-cli-version.sh 1.31.4 through the shared open-cli-bump-pr action.
  3. The script moves the default to 1.31.4, bumps the kit patch version, and adds a changelog entry.
  4. open-cli-bump-pr merges the pull request when the checks pass.
  5. The merge changes the kit changelog on main, so release.yml runs. The new changelog version has no tag, so release.yml releases it:
    1. If the kit signature doesn't verify, release.yml calls sign.yml and stops. With merge: true, sign.yml merges its signature pull request when the checks pass. That merge starts release.yml again.
    2. If the signature verifies, release.yml creates the cloudsmith-cli-vX.Y.Z tag. It then calls publish.yml, and also publish-dockerhub.yml when DOCKERHUB_PUBLISH_ENABLED is true.

CLI 2.0.0 ships

The script changes nothing, prints nothing on stdout, and writes the reason to stderr. An older CLI release gives the same result. A move of the kit to CLI 2.x is a manual change.

Run the bump by hand

Run bump-cli-version.yml from Actions with a version.

Merge this PR

This PR changes spec.yaml, so the merge leaves the cloudsmith-cli signature stale. The first release.yml run signs the kits, merges the signature pull request, and then releases cloudsmith-cli-v0.1.1.

Publish from release.yml

A tag that GITHUB_TOKEN creates starts no workflows. So release.yml calls the publish workflows itself. The publish steps stay in their own workflows, which only gain a workflow_call trigger.

A called workflow gets a certificate that names its own file, but GITHUB_WORKFLOW_REF names the caller. So the publish workflows now verify <repo>/.github/workflows/<their file>@${GITHUB_REF}.

  • A tag push and a manual run give the same identity as before.
  • A call from release.yml on main gives publish.yml@refs/heads/main. The README already documents this identity.
  • TestPublishingRegistryLookup has a new case for this call.

Other changes

TestBumpCLIVersion tests scripts/bump-cli-version.sh in the regression job.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Other (please describe)

Kits Touched

cloudsmith-cli

Verification

  • go test -race ./... and go vet ./... pass
  • shellcheck scripts/*.sh passes when scripts change
  • ./scripts/test-kit.sh <kit> passes for every kit touched (CI runs it. Docker isn't available locally.)
  • ./scripts/test-kit-e2e.sh <kit> passes for every kit touched (not run)
  • sbx kit validate ./<kit> passes for every kit touched (sbx v0.42.1)
  • The kit's README.md matches what the spec now does

actionlint and zizmor also ran on the workflows:

  • actionlint 1.7.12 doesn't know concurrency.queue yet.
  • zizmor reports the # master comment on the open-cli-bump-pr pin. The pin in cloudsmith-cli-action has the same comment.

Additional Notes

ENG-15913.

  • Secrets: add these before the bump workflow runs.
    • CLOUDSMITH_BOT_TOKEN: a Cloudsmith Bot token with Contents: write and Pull requests: write, which can merge past the review rule. sign.yml also merges with this token.
    • CLOUDSMITH_BOT_SSH_SIGNING_KEY: the SSH key that signs Cloudsmith Bot commits.
  • Tags: release.yml creates a lightweight tag through the API. The v0.1.0 tags are signed annotated tags.
  • Timeout: sign.yml now has a 60-minute timeout, because it waits for the checks of its pull request.

Still to do before this PR leaves draft

  • Release installer 0.2.0, which accepts a major version such as 1.
  • Move the pinned installer to 0.2.0, and widen the cli-version pattern to accept a major version.

🤖 Generated with Claude Code

cloudsmith-iduffy and others added 2 commits November 18, 2026 12:45
Set the cli-version default to the current CLI release and release the
kit as 0.1.1. Add scripts/bump-cli-version.sh. It moves the default to
a newer CLI release with the same major version, bumps the kit patch
version and adds an entry to the new cloudsmith-cli/CHANGELOG.md. It
changes nothing for an older release or a new major version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a Bump Cloudsmith CLI workflow. The cloudsmith-cli-release event
starts it, and it merges the bump pull request when the checks pass.

Add a Release cloudsmith-cli kit workflow. It releases the newest
version in cloudsmith-cli/CHANGELOG.md when that version has no tag.
When the kit signature does not verify, it calls sign.yml, which now
can merge its own pull request. The merge starts the release again.
When the signature verifies, it creates the tag and calls the publish
workflows. A tag from GITHUB_TOKEN starts no workflows.

A called publish workflow signs with its own file in the certificate,
not with GITHUB_WORKFLOW_REF. Verify that identity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 18, 2026 12:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The signing workflow can merge a stale signature bundle when main advances because admin merging can bypass branch freshness checks, causing the next release to reject the signature and stop.

1 open issue
What changed in this PR

Pins the cloudsmith-cli kit to CLI 1.31.3 and adds automation to keep the pin current within its major version, sign releases, and publish artifacts.

Changes:

  • Bump the kit to 0.1.1 and document its pinned-release policy.
  • Add a version-bump script, regression tests, and an automated bump workflow.
  • Add release orchestration and reusable signing/publishing workflows with updated certificate identity verification.
File Description
tck/​publishing_test.go Test certificate identities when publishing through a reusable workflow.
tck/​bump_cli_version_test.go Cover version bumps and rejected or skipped inputs.
scripts/​bump-cli-version.sh Update the CLI pin, kit version, and changelog.
CONTRIBUTING.md Document automated bump and release procedures.
cloudsmith-cli/​spec.yaml Set kit version 0.1.1 and CLI default 1.31.3.
cloudsmith-cli/​README.md Explain the pinned default and latest behavior.
cloudsmith-cli/​CHANGELOG.md Record the initial release and updated CLI pin.
.github/​workflows/​sign.yml Support reusable invocation and signature PR merging.
.github/​workflows/​release.yml Coordinate signature verification, tagging, and publishing.
.github/​workflows/​publish.yml Support reusable publishing and adjust identity verification.
.github/​workflows/​publish-dockerhub.yml Support reusable Docker Hub publishing and identity verification.
.github/​workflows/​bump-cli-version.yml Automate CLI bump PRs from release events or manual input.

Review effort: Balanced

Comment thread .github/workflows/sign.yml Resolved
Before sign.yml merges its pull request, compare the kit specs and
files on main with the signed base. When a kit changed, close the pull
request and fail. The release run for that change signs the kits again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The privileged merge-to-publish chain requires a real GitHub Actions run to validate bot bypass permissions, reusable-workflow OIDC trust, and release retriggering, which mocked tests cannot establish.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

cloudsmith-iduffy and others added 2 commits November 18, 2026 17:03
* origin/main:
  ci: use the standard cloudsmith-bot secret names (#6)
Use CLOUDSMITH_BOT_TOKEN for the bot token and
CLOUDSMITH_BOT_SSH_SIGNING_KEY for the commit signing key, the same
names as the other Cloudsmith repositories.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants