feat: add NPM preview release workflow and fix CI permissions#7468
feat: add NPM preview release workflow and fix CI permissions#7468paulbalaji wants to merge 2 commits into
Conversation
|
📝 WalkthroughWalkthroughThis PR layers in snapshot-based versioning for preview releases and swaps out GITHUB_TOKEN for proper GitHub App token authentication across multiple release workflows. Introduces a new preview release pipeline alongside updates to existing release automation. Changes
Sequence DiagramsequenceDiagram
participant User
participant Workflow
participant Git
participant npm as npm Registry
participant GitHub
User->>Workflow: Trigger npm-preview-release<br/>(snapshot_tag: beta)
Workflow->>Workflow: Extract base version<br/>from package.json
Workflow->>Workflow: Compute preview version<br/>(base + tag + SHA)
Workflow->>Workflow: yarn changeset version<br/>--snapshot
Workflow->>Workflow: yarn build
Workflow->>npm: yarn changeset publish<br/>(with npm token)
npm-->>Workflow: Preview packages published
Workflow->>GitHub: Create pre-release<br/>with computed tag
GitHub-->>Workflow: Release created
Workflow->>User: Summary with install<br/>instructions
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings🪛 actionlint (1.7.8).github/workflows/npm-preview-release.yml30-30: label "depot-ubuntu-latest" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file (runner-label) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (53)
🔇 Additional comments (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This PR adds several improvements to the release workflows:
1. **NPM Preview Release Workflow** (`.github/workflows/npm-preview-release.yml`)
- Manual dispatch workflow to publish NPM packages as preview releases
- Supports beta, alpha, rc, and preview dist-tags
- Version format: `{baseVersion}-{tag}.{gitSha}` (e.g., `19.10.0-beta.abc1234`)
- Creates GitHub pre-release with installation instructions
- Can be triggered from any branch
2. **Changeset Snapshot Configuration** (`.changeset/config.json`)
- Added `snapshot` config for preview release versioning
- Uses `{tag}.{commit}` format for prerelease identifiers
3. **CI Permissions Fix** (`.github/workflows/release.yml`)
- Uses GitHub App token instead of GITHUB_TOKEN
- Fixes issue where CI wouldn't trigger on changesets PRs
- Added `title` override to pass PR title lint ("chore: release npm packages")
4. **CI Permissions Fix** (`.github/workflows/rust-release.yml`)
- Uses GitHub App token instead of GITHUB_TOKEN
- Fixes issue where CI wouldn't trigger on release PRs
**Setup Required:**
Create a GitHub App with the following:
- Permissions: Contents (read/write), Pull requests (read/write)
- Install the app on this repository
- Add these secrets:
- `HYPERLANE_GITHUB_APP_ID`: The App ID
- `HYPERLANE_GITHUB_APP_PRIVATE_KEY`: The private key
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
591b0d4 to
3a3e484
Compare
This aligns the Rust prerelease versioning with NPM's behavior. Previously: 1.7.0 -> 1.7.0-preview.1 Now: 1.7.0 -> 1.8.0-preview.1 (uses next calculated version) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary
titleoverride to changesets action so PRs pass PR title lintNPM Preview Release Workflow
New workflow that allows publishing preview releases to NPM:
beta,alpha,rc,preview{baseVersion}-{tag}.{gitSha}(e.g.,19.10.0-beta.abc1234)Usage
Installation
After running, users can install preview packages:
CI Permissions Fix
Both NPM and Rust release workflows now use a GitHub App token instead of
GITHUB_TOKEN. This fixes the issue where merging/pushing release PRs wouldn't trigger other CI workflows.Setup Required
Create a GitHub App with:
hyperlane-release-bot(or similar)Install the app on this repository
Add these repository secrets:
HYPERLANE_GITHUB_APP_ID: The App ID from the app's settingsHYPERLANE_GITHUB_APP_PRIVATE_KEY: Generate and download a private keyTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.