Skip to content

👷 [RUM-15055] add release / publish pipeline#56

Merged
bcaudan merged 9 commits into
mainfrom
bcaudan/npm-publish
Mar 26, 2026
Merged

👷 [RUM-15055] add release / publish pipeline#56
bcaudan merged 9 commits into
mainfrom
bcaudan/npm-publish

Conversation

@bcaudan

@bcaudan bcaudan commented Mar 23, 2026

Copy link
Copy Markdown
Collaborator

Motivation

The SDK had no release tooling. This adds a full end-to-end release pipeline covering version bumping, changelog generation, npm publishing via OIDC Trusted Publishers, and GitHub Release creation.

Changes

Release / publish workflow:

  1. Prepare release locally and open PR with version bump + changelog
  2. When the PR is merged, the commit is tagged and a notification is sent with a link to the publish workflow
  3. Run the publish workflow manually, publishing github release and npm package

Scripts (scripts/):

  • lib/semver.ts — pure bumpVersion(current, bump) utility with tests
  • lib/changelog.ts — gitmoji-based commit categorization and Markdown changelog section generation with tests
  • lib/git.ts — shared getCommitsSinceLastTag() utility used by both CLI scripts
  • generate-changelog.ts — CLI wrapper that prints a changelog section to stdout
  • prepare-release.ts — interactive local script: preflight checks ($EDITOR, gh auth, clean tree) → version prompt (patch/minor/major/custom) → changelog draft opened in $EDITOR → release branch + GitHub PR. Supports --dry-run. Exposed as yarn release.

GitHub Actions:

  • .github/workflows/tag-release.yml — triggers on push to main; automatically creates a vX.Y.Z git tag when the commit message matches a release version
  • .github/workflows/publish.yml — triggered manually via workflow_dispatch on the release tag; validates the commit is a release commit, publishes to npm with OIDC Trusted Publishers (--provenance, no NODE_AUTH_TOKEN needed), creates a GitHub Release with changelog section extracted from CHANGELOG.md

GitLab CI (.gitlab-ci.yml):

  • Adds notify-release-ready job: fires when a vX.Y.Z tag is pushed, posts a Slack message to #rum-electron-sdk-ops with the workflow URL and the tag ref to use

Docs (docs/DEVELOPMENT.md):

  • Add "Commit messages and Pull Request titles" section, similar to browser-sdk
  • Adds "Releasing" section covering prerequisites, full release flow, and dry-run modes

Test instructions

  1. Dry-run the prepare-release script:

    EDITOR=cat yarn release --dry-run

    Expected: preflight checks run, version prompt shown, changelog preview printed, no git changes.

  2. Preview changelog generation:

    node scripts/generate-changelog.ts 1.0.0

    Expected: Markdown section printed to stdout with commits grouped by gitmoji category.

Checklist

  • Tested locally (playground)
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated related documentation.

@bcaudan bcaudan changed the title 👷 [RUM-15055] add release pipeline: prepare-release script, npm OIDC publish, changelog generation 👷 [RUM-15055] add release pipeline Mar 23, 2026
@bcaudan bcaudan force-pushed the bcaudan/npm-publish branch 9 times, most recently from 2ef1e13 to 87a534a Compare March 24, 2026 17:16
@bcaudan bcaudan changed the title 👷 [RUM-15055] add release pipeline 👷 [RUM-15055] add release / publish pipeline Mar 25, 2026
@bcaudan bcaudan force-pushed the bcaudan/npm-publish branch from f0fdf31 to 87a534a Compare March 25, 2026 08:33
bcaudan added 4 commits March 25, 2026 09:49
- server bump
- changelog generation
- script unit tests
- on release PR merge in main, create a release tag
- manual workflow to publish a release
@bcaudan bcaudan force-pushed the bcaudan/npm-publish branch from 87a534a to e4cc9ea Compare March 25, 2026 08:50
@bcaudan bcaudan force-pushed the bcaudan/npm-publish branch from e4cc9ea to 6e33e0d Compare March 25, 2026 09:13
@bcaudan bcaudan marked this pull request as ready for review March 25, 2026 09:19
@bcaudan bcaudan requested a review from a team as a code owner March 25, 2026 09:19

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e33e0d1a2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/tag-release.yml Outdated
Comment thread scripts/lib/git.ts

@cdn34dd cdn34dd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The PR looks good as-is for now 👍.

One thing we do in the React Native SDK that could prove beneficial here is release content validation: during version bump, we pack the tarball, list its contents, and commit that file list as a baseline (release-content.txt). Then before publish, we pack again and compare against the committed baseline. If the files differ, the workflow fails.

This catches any drift in what gets packaged (accidental file inclusions or missing files) before reaching npm. If the change is intentional, we need to regenerate the baseline and commit it, which shows up in the PR diff.

@bcaudan

bcaudan commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator Author

The PR looks good as-is for now 👍.

One thing we do in the React Native SDK that could prove beneficial here is release content validation: during version bump, we pack the tarball, list its contents, and commit that file list as a baseline (release-content.txt). Then before publish, we pack again and compare against the committed baseline. If the files differ, the workflow fails.

This catches any drift in what gets packaged (accidental file inclusions or missing files) before reaching npm. If the change is intentional, we need to regenerate the baseline and commit it, which shows up in the PR diff.

That seems pretty interesting 👍
I'll add it with the review of the package content.

@bcaudan bcaudan merged commit 0fdad37 into main Mar 26, 2026
12 checks passed
@bcaudan bcaudan deleted the bcaudan/npm-publish branch March 26, 2026 08:14
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