Monorepo release automation for pnpm workspaces. Handles version calculation, dependency graph resolution, changelog generation, and GitHub integration.
npm install @ucdjs/release-scriptsimport{createReleaseScripts}from"@ucdjs/release-scripts";constrelease=awaitcreateReleaseScripts({repo: "owner/repo",githubToken: process.env.GITHUB_TOKEN,});// Prepare a release (calculate versions, update package.json files, create PR)constresult=awaitrelease.prepare();// Verify a release branch matches expected stateawaitrelease.verify();// Publish packages to npmawaitrelease.publish();constrelease=awaitcreateReleaseScripts({repo: "owner/repo",githubToken: "...",workspaceRoot: process.cwd(),dryRun: false,safeguards: true,globalCommitMode: "dependencies",packages: {include: ["@scope/pkg-a","@scope/pkg-b"],exclude: ["@scope/internal"],excludePrivate: true,},branch: {release: "release/next",default: "main",},npm: {provenance: true,access: "public",},changelog: {enabled: true,emojis: true,},});// List all workspace packagesconstpackages=awaitrelease.packages.list();// Get a specific packageconstpkg=awaitrelease.packages.get("@scope/pkg-a");Calculates version bumps from conventional commits, updates package.json files, generates changelogs, and creates/updates a release pull request.
Validates that a release branch matches expected release artifacts. Compares expected vs actual versions and dependency ranges, then sets a GitHub commit status.
Publishes packages to npm in topological order with provenance support, creates git tags, and pushes them to the remote.
When used in a script, the following flags are supported:
--dry/-d- Dry-run mode, no changes are made--verbose/-v- Enable verbose logging
Published under MIT License.