Skip to content

ci: publish preview releases with pkg.pr.new - #35

Merged
PunGrumpy merged 1 commit into
mainfrom
ci/preview-releases
Sep 10, 2026
Merged

PunGrumpy merged 1 commit into
mainfrom
ci/preview-releases

Conversation

@PunGrumpy

@PunGrumpy PunGrumpy commented Sep 10, 2026 •

Copy link
Copy Markdown
Owner

Description

There is currently no way to hand someone an unreleased build of the CLI. Metadata bugs are site-shaped — they need the reporter's own URL, their own headers, their own crawler behaviour — so "does main fix it?" today means asking them to clone and build the monorepo, or burning a real npm version on a snapshot just to produce a tarball.

This adds .github/workflows/preview-release.yml. Every push to main and every pull request builds og-tester and publishes it to pkg.pr.new, which serves the tarball from its own CDN and never touches the npm registry:

bunx https://pkg.pr.new/og-tester@<sha>

A bot comment with the install line lands on each PR automatically. The changesets release flow is untouched.

Notes on the shape of it:

  • pull_request plus push on main only, so a PR branch does not run the job twice
  • build filtered to og-tester, matching release.yml, so web stays out of it
  • the @og-tester/core bundling smoke check from release.yml runs here too — a preview tarball that still imports the private workspace package would be broken on install, and this catches it on the PR rather than at release time
  • action versions and the Bun cache step copied from release.yml
  • if: github.repository_owner == 'PunGrumpy' so forks don't try to publish
  • the publish step retries up to four times with backoff — pkg.pr.new returns transient 5xx often enough to matter

Adapted from millionco/react-doctor.

Verification

The pkg.pr.new GitHub App has to be installed on this repo before this merges, otherwise the publish step fails. No tokens or secrets needed beyond that. The run on this PR is the real check — it repeats the build and smoke check that release.yml runs on every push to main today.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added automated preview releases for changes pushed to the main branch and pull requests.
    • Preview packages are built, validated, and published with retry handling for improved reliability.
  • Chores
    • Added automated dependency caching and concurrency controls to streamline preview release workflows.

Every push to main and every pull request now builds og-tester and
publishes it to pkg.pr.new, so a fix can be installed from a commit sha
before it ships to npm — without consuming a version number on the
registry the way a snapshot publish would.

The bundling smoke check from the release workflow runs here too, so a
preview tarball can never ship a dist that still imports the private
@og-tester/core workspace package.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
og-tester Ready Ready Preview Sep 10, 2026 6:31pm UTC

@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: db8dae6

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

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 52f501b8-f139-40ad-9c52-b44cddb8cf8b

📥 Commits

Reviewing files that changed from the base of the PR and between 8a0f281 and db8dae6.

📒 Files selected for processing (1)
  • .github/workflows/preview-release.yml

📝 Walkthrough

Walkthrough

Adds a GitHub Actions workflow for preview releases on main pushes and pull requests. It installs and builds the CLI, validates the bundle, and publishes it to pkg.pr.new with retries.

Changes

Preview release automation

Layer / File(s) Summary
Workflow triggers and execution controls
.github/workflows/preview-release.yml
The workflow handles pushes to main and pull requests. It uses PR-specific concurrency, read-only contents permissions, and repository-owner gating.
CLI build and artifact validation
.github/workflows/preview-release.yml
The job configures Bun, restores caches, installs dependencies, builds og-tester, and checks the generated CLI artifact.
Retrying preview publication
.github/workflows/preview-release.yml
The workflow publishes ./packages/cli to pkg.pr.new with up to four attempts and exponential backoff.

Estimated code review effort: 2 (Simple) | ~10 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/preview-releases

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.

❤️ Share

A rabbit checks the bundle bright
Bun hops through the build at night
Four tries carry previews near
The CLI leaps from burrow clear
A tiny release lands just right

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Sep 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/og-tester@35

commit: db8dae6

@PunGrumpy
PunGrumpy merged commit 981203a into main Sep 10, 2026
10 of 11 checks passed
@PunGrumpy
PunGrumpy deleted the ci/preview-releases branch September 10, 2026 18:31

This branch was successfully deployed

1 active deployment
Preview — db8dae6e Deployed Sep 10, 2026 by vercel[bot]
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.

1 participant