Skip to content

ci(build): Add snapshot release workflow#3212

Merged
runningcode merged 7 commits intomasterfrom
no/ci-snapshot
Mar 19, 2026
Merged

ci(build): Add snapshot release workflow#3212
runningcode merged 7 commits intomasterfrom
no/ci-snapshot

Conversation

@runningcode
Copy link
Contributor

@runningcode runningcode commented Mar 12, 2026

Summary

Adds a workflow_dispatch-triggered snapshot release pipeline that reuses the existing build workflow, enabling on-demand pre-release builds from any branch. For now we are only publishing to npm under the snapshot tag.

Background

We want to allow easy snapshot releases to ease internal testing as well as customer testing.

What it does

  • New snapshot.yml workflow: Computes a semver-compliant snapshot version (e.g. 3.4.0-snapshot.20260312.abc1234) by bumping the minor version from Cargo.toml, patches all version files via scripts/bump-version.sh, pushes a temporary snapshot branch, then triggers the build
  • Makes build.yml callable: Adds workflow_call inputs (skip-signing, is-snapshot, checkout-ref) so the snapshot workflow can reuse the full build matrix
  • Skips unnecessary steps for snapshots: macOS code signing/notarization, Python package builds, Docker image builds, and the release merge job are all conditionally skipped
  • Publishes to npm under snapshot tag: Platform-specific binary packages and the main @sentry/cli package are published with --tag snapshot so they don't affect the latest tag
  • Cleans up after itself: The temporary snapshot branch is deleted after publishing (or on failure)

🤖 Generated with Claude Code

Add a workflow_dispatch-triggered snapshot release pipeline that reuses
the existing build workflow. Snapshot builds skip macOS code signing,
override versions with a snapshot identifier, and publish to npm under
the `snapshot` tag.

- Add `workflow_call` inputs to build.yml for `skip-signing` and
  `snapshot-version`
- Add `override-version` composite action to patch Cargo.toml,
  package.json, and npm-binary-distributions
- Add `snapshot.yml` workflow that computes a snapshot version, triggers
  the build, and publishes to npm
- Skip Python, Docker, and merge jobs for snapshot builds

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of patching version files at build time via the override-version
composite action, snapshots now follow the same pattern as releases:
bump all version files upfront using bump-version.sh, commit to a
temporary snapshot branch, and let build.yml build from correct source.

This removes the fragile override-version action (called 5 times across
different jobs with sed/awk/node), replaces the snapshot-version input
with checkout-ref and is-snapshot, and adds a cleanup job to delete the
temporary branch after publish.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@@ -0,0 +1,114 @@
name: Snapshot Release

on:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

manual trigger to test. we can change this to build on every push to master once we know it is working.

Copy link
Member

Choose a reason for hiding this comment

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

l: I would be fine with just having it set to every push to master with this PR. We can revert if needed

with:
node-version: '20.10.0'

- name: Bump versions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

so another way to do this would be to modify the versions in place in the action/workflow using sed and regexes.

this would remove the need to commit and create the snapshot branch somewhere but then we have two different mechanisms to patch the versions which could lead to drift. without modifying in place, there's no way to share the patched repo between workflows.

if-no-files-found: 'error'

platform-specific-docker:
if: ${{ !inputs.is-snapshot }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

skip docker publishing

@@ -297,11 +327,14 @@ jobs:
if-no-files-found: 'error'

python:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not publishing to pip

is-snapshot:
type: boolean
default: false
checkout-ref:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need this checkout-ref to share the version patched repo between workflows. see comment here for more details: https://github.com/getsentry/sentry-cli/pull/3212/changes#r2924915514

@runningcode runningcode marked this pull request as ready for review March 12, 2026 14:27
@runningcode runningcode requested review from a team and szokeasaurusrex as code owners March 12, 2026 14:27
The upload artifact preserves the platform subdirectory structure
(e.g., darwin/, linux-x64/), so after download the tarballs land at
npm-distributions/<platform>/*.tgz, not npm-distributions/*.tgz.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The node job downloads artifact-bin-* which includes macOS artifacts
uploaded by sign-macos-binaries, but didn't declare that dependency.
This could cause the npm package to be built with incomplete checksums
(missing macOS entries). sign-macos-binaries already depends on macos
and macos_universal, so those are covered transitively.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@szokeasaurusrex
Copy link
Member

Hey @runningcode, please check the AI review comments and resolve them, or mark as inapplicable, then I'll do a full review 🙏

@runningcode
Copy link
Contributor Author

Done. One is false, the other is a design choice. I commented on both!

Copy link
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @runningcode! I added some thoughts here.

Remove the skip-signing input from build.yml since snapshots should
go through the same signing pipeline as releases. Also switch snapshot
versioning from minor bump to patch bump and use cargo metadata for
more reliable version parsing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
szokeasaurusrex added a commit that referenced this pull request Mar 19, 2026
Split from #3212, thanks @runningcode for noticing!

Co-authored-by: Nelson Osacky <nelson.osacky@sentry.io>
Copy link
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

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

🚀

@@ -0,0 +1,114 @@
name: Snapshot Release

on:
Copy link
Member

Choose a reason for hiding this comment

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

l: I would be fine with just having it set to every push to master with this PR. We can revert if needed

runningcode and others added 2 commits March 19, 2026 15:56
Co-authored-by: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@runningcode runningcode merged commit a1e2592 into master Mar 19, 2026
26 checks passed
@runningcode runningcode deleted the no/ci-snapshot branch March 19, 2026 15:49
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