Repository navigation
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
Draft
cloudsmith-iduffy wants to merge 5 commits into
cloudsmith-iduffy wants to merge 5 commits into
Conversation
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>
There was a problem hiding this comment.
🟡 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
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>
There was a problem hiding this comment.
🔵 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
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Sandboxes that use the
cloudsmith-clikit'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-versiondefault to1.31.3, the current CLI release, and releases the kit as0.1.1.latestis still accepted. The kit README and the newcloudsmith-cli/CHANGELOG.mddescribe the change.CLI 1.31.4 ships
cloudsmith-cli-releaseevent to this repository (feat(ENG-15913): add a release channel for each major version cloudsmith-cli#627).bump-cli-version.ymlrunsscripts/bump-cli-version.sh 1.31.4through the sharedopen-cli-bump-praction.open-cli-bump-prmerges the pull request when the checks pass.main, sorelease.ymlruns. The new changelog version has no tag, sorelease.ymlreleases it:release.ymlcallssign.ymland stops. Withmerge: true,sign.ymlmerges its signature pull request when the checks pass. That merge startsrelease.ymlagain.release.ymlcreates thecloudsmith-cli-vX.Y.Ztag. It then callspublish.yml, and alsopublish-dockerhub.ymlwhenDOCKERHUB_PUBLISH_ENABLEDistrue.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.ymlfrom Actions with a version.Merge this PR
This PR changes
spec.yaml, so the merge leaves thecloudsmith-clisignature stale. The firstrelease.ymlrun signs the kits, merges the signature pull request, and then releasescloudsmith-cli-v0.1.1.Publish from
release.ymlA tag that
GITHUB_TOKENcreates starts no workflows. Sorelease.ymlcalls the publish workflows itself. The publish steps stay in their own workflows, which only gain aworkflow_calltrigger.A called workflow gets a certificate that names its own file, but
GITHUB_WORKFLOW_REFnames the caller. So the publish workflows now verify<repo>/.github/workflows/<their file>@${GITHUB_REF}.release.ymlonmaingivespublish.yml@refs/heads/main. The README already documents this identity.TestPublishingRegistryLookuphas a new case for this call.Other changes
TestBumpCLIVersiontestsscripts/bump-cli-version.shin the regression job.Type of Change
Kits Touched
cloudsmith-cli
Verification
go test -race ./...andgo vet ./...passshellcheck scripts/*.shpasses 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)README.mdmatches what the spec now doesactionlintandzizmoralso ran on the workflows:actionlint1.7.12 doesn't knowconcurrency.queueyet.zizmorreports the# mastercomment on theopen-cli-bump-prpin. The pin incloudsmith-cli-actionhas the same comment.Additional Notes
ENG-15913.
CLOUDSMITH_BOT_TOKEN: a Cloudsmith Bot token withContents: writeandPull requests: write, which can merge past the review rule.sign.ymlalso merges with this token.CLOUDSMITH_BOT_SSH_SIGNING_KEY: the SSH key that signs Cloudsmith Bot commits.release.ymlcreates a lightweight tag through the API. Thev0.1.0tags are signed annotated tags.sign.ymlnow has a 60-minute timeout, because it waits for the checks of its pull request.Still to do before this PR leaves draft
1.cli-versionpattern to accept a major version.🤖 Generated with Claude Code