Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 3.5 KB

RELEASING.md

File metadata and controls

49 lines (31 loc) · 3.5 KB

Release Vite Doctor

Doctor uses uppt to create release PRs and publish the vite-doctor package to npm. Merging the release PR is the approval: the workflow publishes without a further step on npm.

Configure publishing once

Before merging the first release PR:

  1. In the repository's Settings → Actions → General → Workflow permissions, enable Allow GitHub Actions to create and approve pull requests.
  2. Create a GitHub environment named npm. Restrict its deployment tags to v*.
  3. In the existing vite-doctor package's npm access settings, configure a GitHub Actions trusted publisher with owner loadsheet, repository vite-doctor, workflow release.yml, and environment npm. Enable the npm publish permission.

The workflow uses GITHUB_TOKEN and npm OIDC trusted publishing. It does not need an npm token secret.

Release a version

  1. Merge changes into main using conventional commit titles such as fix: ... or feat: .... On each push, uppt creates or updates a draft release/vX.Y.Z PR from the changes since the previous release.
  2. Review the proposed version and release notes, mark the PR ready, and merge it.
  3. Wait for the Release workflow to verify the merged commit. It runs formatting, build, lint, unit tests, and packed-package checks, including Linux, macOS, and Windows on Node 22.20.0 and 24. Release PRs created with GITHUB_TOKEN may not run normal PR CI, so this verification is required before tagging.
  4. The workflow creates the version tag and GitHub release, then dispatches a run on that tag. That run verifies the tagged commit, builds and packs the root package, and publishes its tarball to npm with provenance. The publish job does not check out or build repository code.
  5. Confirm the version and dist-tag on npm. A GitHub release alone does not mean the npm package is available.

pnpm pack builds Doctor through prepack. The docs workspace is not published. PR and main preview packages continue through pkg-pr-new.

The publish workflow preserves the existing dist-tag mapping: -alpha versions use alpha, -beta versions use beta, -rc versions use rc, and other versions use latest. This mapping does not add a prerelease-version selector to uppt's generated release PRs. Use only the supported prerelease channels when preparing a prerelease tag.

Check a release locally

pnpm install --frozen-lockfile
pnpm release:check
pnpm pack --pack-destination artifacts

The packed-package check installs the tarball in a temporary consumer and checks exports, the vite-doctor CLI, the nuxt-doctor shim, and nuxt doctor. Run pnpm exec vp fmt to fix formatting before repeating the read-only release checks.

Recover a failed release

If verification fails before tagging, fix the failure before retrying. If the fix changes repository code, prepare a new release commit; rerunning verification still checks the original merged commit.

If the tag exists but packing or publishing failed, dispatch the Release workflow on that exact tag:

gh workflow run release.yml --repo loadsheet/vite-doctor --ref vX.Y.Z

Dispatching on a branch does not publish. Dispatching on a version tag reruns all release checks before packing. Pushing a tag alone no longer starts a release.

A rerun skips a version that is already on npm. If a version went out with the wrong dist-tag, fix it with npm dist-tag add vite-doctor@X.Y.Z <tag>. An already published version can't be replaced and requires a new version number.