Skip to content

feat: add NPM preview release workflow and fix CI permissions (pnpm)#7470

Closed
paulbalaji wants to merge 2 commits into
pbio-cursor/investigate-pnpm-package-manager-migration-2193from
pbio/npm-preview-release-workflow-pnpm
Closed

feat: add NPM preview release workflow and fix CI permissions (pnpm)#7470
paulbalaji wants to merge 2 commits into
pbio-cursor/investigate-pnpm-package-manager-migration-2193from
pbio/npm-preview-release-workflow-pnpm

Conversation

@paulbalaji
Copy link
Copy Markdown
Collaborator

Summary

  • Add NPM preview release workflow for publishing snapshot/preview releases (using pnpm)
  • Add changeset snapshot configuration
  • Fix CI permissions issue where workflows wouldn't trigger on changesets/release PRs (both NPM and Rust)
  • Add title override to changesets action so PRs pass PR title lint

Note: This PR is based on the pbio-cursor/investigate-pnpm-package-manager-migration-2193 branch (pnpm migration). There is a parallel PR for the main branch (yarn): #7468

NPM Preview Release Workflow

New workflow that allows publishing preview releases to NPM:

  • Trigger: Manual dispatch (workflow_dispatch) from GitHub Actions UI
  • Dist-tags: beta, alpha, rc, preview
  • Version format: {baseVersion}-{tag}.{gitSha} (e.g., 19.10.0-beta.abc1234)
  • Branch policy: Can be triggered from any branch
  • Output: Creates GitHub pre-release with installation instructions
  • Package Manager: pnpm (vs yarn in the main branch PR)

Usage

  1. Go to Actions → "NPM Preview Release"
  2. Click "Run workflow"
  3. Select the branch and dist-tag
  4. The workflow will:
    • Create snapshot versions using changesets
    • Build all packages
    • Publish to NPM with the selected dist-tag
    • Create a GitHub pre-release

Installation

After running, users can install preview packages:

npm install @hyperlane-xyz/sdk@beta
npm install @hyperlane-xyz/cli@beta

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

  1. Create a GitHub App with:

    • Name: hyperlane-release-bot (or similar)
    • Permissions:
      • Contents: Read & Write
      • Pull requests: Read & Write
  2. Install the app on this repository

  3. Add these repository secrets:

    • HYPERLANE_GITHUB_APP_ID: The App ID from the app's settings
    • HYPERLANE_GITHUB_APP_PRIVATE_KEY: Generate and download a private key

Test plan

  • Verify NPM preview release workflow appears in Actions tab
  • Create GitHub App and add secrets
  • Test preview release workflow on a non-main branch
  • Verify the generated GitHub release has correct installation instructions
  • Verify changesets PR creation still works
  • Verify Rust release PR creation still works
  • Verify CI triggers when changesets/release PRs are pushed

🤖 Generated with Claude Code

This PR adds several improvements to the release workflows for the pnpm branch:

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
   - Uses pnpm instead of yarn

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>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 26, 2025

⚠️ No Changeset found

Latest commit: 9cd5772

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@paulbalaji paulbalaji marked this pull request as draft November 26, 2025 14:11
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@paulbalaji paulbalaji closed this Nov 26, 2025
@github-project-automation github-project-automation Bot moved this from In Review to Done in Hyperlane Tasks Nov 26, 2025
@paulbalaji paulbalaji deleted the pbio/npm-preview-release-workflow-pnpm branch November 26, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant