Repository navigation
feat(ENG-15913): pin and auto-bump the CLI release in the cloudsmith-cli kit #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
cloudsmith-iduffy
wants to merge
5
commits into
main
Choose a base branch
from
eng-15913
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
359d185
feat(ENG-15913): pin the cloudsmith-cli kit to CLI 1.31.3
cloudsmith-iduffy ecec40f
feat(ENG-15913): bump and release the cloudsmith-cli kit automatically
cloudsmith-iduffy 616f89a
feat(ENG-15913): do not merge a signature for a changed kit
cloudsmith-iduffy f2f1e11
Merge branch 'main' into eng-15913
cloudsmith-iduffy 1a2a28c
ci(ENG-15913): use the standard cloudsmith-bot secret names
cloudsmith-iduffy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| name: Bump Cloudsmith CLI | ||
|
|
||
| # Opens a pull request that pins the default cli-version of the cloudsmith-cli | ||
| # kit to a Cloudsmith CLI release. The CLI release workflow sends the | ||
| # cloudsmith-cli-release event. Run the workflow by hand to pin a specific | ||
| # version. | ||
| on: | ||
| repository_dispatch: | ||
| types: | ||
| - cloudsmith-cli-release | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: The Cloudsmith CLI version to pin, for example 1.31.3. | ||
| required: true | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: bump-cli-version | ||
| cancel-in-progress: false | ||
| queue: max | ||
|
|
||
| jobs: | ||
| bump: | ||
| name: Open the bump pull request | ||
| permissions: | ||
| contents: read | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - name: Open the bump pull request | ||
| uses: cloudsmith-io/cloudsmith-cli/.github/actions/open-cli-bump-pr@34f5fd967daaab552a66dd9a890d550c47a39b0c # master | ||
| with: | ||
| version: ${{ github.event.client_payload.version || inputs.version }} | ||
| bump-command: bash scripts/bump-cli-version.sh "$VERSION" | ||
| merge: "true" | ||
| token: ${{ secrets.CLOUDSMITH_BOT_TOKEN }} | ||
| ssh-signing-key: ${{ secrets.CLOUDSMITH_BOT_SSH_SIGNING_KEY }} |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| name: Release cloudsmith-cli kit | ||
|
|
||
| # Releases the newest version in cloudsmith-cli/CHANGELOG.md when no tag exists | ||
| # for it yet. A kit whose signature does not verify is signed first; the merge | ||
| # of the signature pull request starts this workflow again. A tag that | ||
| # GITHUB_TOKEN creates starts no workflows, so this workflow calls the publish | ||
| # workflows itself. | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - cloudsmith-cli/CHANGELOG.md | ||
| - cloudsmith-cli/kit.sig.bundle | ||
| workflow_dispatch: {} | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: release-cloudsmith-cli | ||
| cancel-in-progress: false | ||
| queue: max | ||
|
|
||
| jobs: | ||
| version: | ||
| name: Find the version to release | ||
| if: github.ref == 'refs/heads/main' | ||
| permissions: | ||
| contents: read | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| outputs: | ||
| tag: ${{ steps.version.outputs.tag }} | ||
| released: ${{ steps.version.outputs.released }} | ||
| signed: ${{ steps.signature.outputs.signed }} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| fetch-depth: 2 | ||
| persist-credentials: false | ||
|
|
||
| - name: Read the newest CHANGELOG version | ||
| id: version | ||
| run: | | ||
| set -euo pipefail | ||
| version="$(sed -n 's/^## \[\([0-9]*\.[0-9]*\.[0-9]*\)\].*/\1/p' cloudsmith-cli/CHANGELOG.md | head -n 1)" | ||
| grep -Fxq "version: \"$version\"" cloudsmith-cli/spec.yaml || | ||
| { echo "::error::cloudsmith-cli/spec.yaml does not have version $version"; exit 1; } | ||
| tag="cloudsmith-cli-v$version" | ||
| echo "tag=$tag" >> "$GITHUB_OUTPUT" | ||
| status=0 | ||
| git ls-remote --exit-code --tags origin "refs/tags/$tag" > /dev/null || status=$? | ||
| case "$status" in | ||
| 0) echo "$tag is already released"; echo "released=true" >> "$GITHUB_OUTPUT" ;; | ||
| 2) echo "$tag is not released yet"; echo "released=false" >> "$GITHUB_OUTPUT" ;; | ||
| *) exit "$status" ;; | ||
| esac | ||
|
|
||
| - name: Install sbx | ||
| if: steps.version.outputs.released == 'false' | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| CLI_ONLY: "1" | ||
| run: ./scripts/install-sbx.sh >> "$GITHUB_PATH" | ||
|
|
||
| - name: Verify the kit signature | ||
| id: signature | ||
| if: steps.version.outputs.released == 'false' | ||
| env: | ||
| REPOSITORY: ${{ github.repository }} | ||
| run: | | ||
| set -euo pipefail | ||
| if sbx kit verify \ | ||
| --certificate-identity "https://github.com/${REPOSITORY}/.github/workflows/sign.yml@refs/heads/main" \ | ||
| --certificate-oidc-issuer https://token.actions.githubusercontent.com ./cloudsmith-cli; then | ||
| echo "signed=true" >> "$GITHUB_OUTPUT" | ||
| elif git diff --quiet HEAD^ HEAD -- cloudsmith-cli/kit.sig.bundle; then | ||
| echo "signed=false" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "::error::The new signature of the cloudsmith-cli kit does not verify" | ||
| exit 1 | ||
| fi | ||
|
|
||
| sign: | ||
| name: Sign the kits | ||
| needs: version | ||
| if: needs.version.outputs.released == 'false' && needs.version.outputs.signed == 'false' | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| uses: ./.github/workflows/sign.yml | ||
| with: | ||
| merge: true | ||
| secrets: | ||
| CLOUDSMITH_BOT_TOKEN: ${{ secrets.CLOUDSMITH_BOT_TOKEN }} | ||
| CLOUDSMITH_BOT_NAME: ${{ secrets.CLOUDSMITH_BOT_NAME }} | ||
| CLOUDSMITH_BOT_EMAIL: ${{ secrets.CLOUDSMITH_BOT_EMAIL }} | ||
| CLOUDSMITH_BOT_SSH_SIGNING_KEY: ${{ secrets.CLOUDSMITH_BOT_SSH_SIGNING_KEY }} | ||
|
|
||
| tag: | ||
| name: Create the release tag | ||
| needs: version | ||
| if: needs.version.outputs.released == 'false' && needs.version.outputs.signed == 'true' | ||
| permissions: | ||
| contents: write | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Create the release tag | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| TAG: ${{ needs.version.outputs.tag }} | ||
| run: | | ||
| gh api --method POST "repos/$GITHUB_REPOSITORY/git/refs" \ | ||
| -f "ref=refs/tags/$TAG" -f "sha=$GITHUB_SHA" | ||
|
|
||
| publish: | ||
| name: Publish to Cloudsmith | ||
| needs: [version, tag] | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| uses: ./.github/workflows/publish.yml | ||
| with: | ||
| tag: ${{ needs.version.outputs.tag }} | ||
|
|
||
| publish-dockerhub: | ||
| name: Publish to Docker Hub | ||
| needs: [version, tag] | ||
| if: vars.DOCKERHUB_PUBLISH_ENABLED == 'true' | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| uses: ./.github/workflows/publish-dockerhub.yml | ||
| with: | ||
| tag: ${{ needs.version.outputs.tag }} | ||
| secrets: | ||
| DOCKERHUB_PUBLISH_USER: ${{ secrets.DOCKERHUB_PUBLISH_USER }} | ||
| DOCKERHUB_PUBLISH_TOKEN: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }} |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Changelog | ||
|
|
||
| This file records the changes in each release of the cloudsmith-cli kit. | ||
|
|
||
| ## [0.1.1] - 2026-11-18 | ||
|
|
||
| ### Changed | ||
|
|
||
| - Pin the default `cli-version` to Cloudsmith CLI 1.31.3. | ||
|
|
||
| ## [0.1.0] - 2026-09-11 | ||
|
|
||
| ### Added | ||
|
|
||
| - Install the Cloudsmith CLI with Cloudsmith's pinned installer. |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.