Skip to content

release ​

Run the whole release in one command - bump, changelog, publish, commit, tag, push, provider release, social posts, branch sync and PR comment.

Usage ​

bash
relizy release [options]

Without a type flag, the bump of each package is computed from its commits (see SemVer Convention). The global options apply too (--dry-run, --group, --pr-number, --no-safety-check...).

Steps ​

Before the first step, release checks that it can run to the end, so a failure does not leave a half-done release:

  • the new versions can be confirmed: an interactive terminal, or --yes;
  • unless --no-safety-check: the token of the git provider (and the AI provider when used), the access to the registry (npm and pnpm), the credentials of the enabled social platforms, and, when the release commit is pushed, that the branch is up to date with its upstream and can be pushed to, and that the branches to sync (the rules that match the released branch) exist and can get the release.

Then the steps run in this order:

#StepWhat it doesSkipped by
1BumpComputes the new versions, asks to confirm them, writes the package.json files. When no commit triggers a bump, comments the PR (no-release), shows the summary, writes the report and stops with code 0, without success:release-
2ChangelogWrites the CHANGELOG.md files, then runs --format-cmd--no-changelog
3PublishRuns --build-cmd, then publishes the packages in dependency order--no-publish
4Commit and tagCommits the release files and creates the tags--no-commit (tags: --no-git-tag)
5PushPushes the commit and the tags--no-push, --no-commit
6Branch syncMerges the released branch into the branches of the rules of sync that match it and pushes them, or opens a pull request into each one, right after the push. Only when a rule matches and the release commit is pushed, see Branch Sync--no-sync, --no-push, --no-commit
7Provider releaseCreates the GitHub or GitLab releases--no-provider-release
8SocialPosts on X (Twitter) and Slack, when a platform is enabled in social--no-social
9PR commentComments the pull request or merge request of the release--no-pr-comment
10Summary and success:releaseShows the summary, writes the report, runs the success:release hook-

--no-commit skips the commit, the tags and the push. --no-git-tag only skips the tags: the commit is still created and pushed. Each step but the PR comment runs its before:*, success:* and error:* hooks.

A failed provider release, social post, branch sync (a conflict, a refused push) or PR comment does not stop the release: the step is marked as failed in the summary, and the release ends with success:release and code 0. Any other error, a failed check included, stops it, writes the failed report, posts a failed PR comment, runs the error:release hook and exits with code 1.

Branch Safety ​

The packages are published before the release commit and its tags are pushed, so a failed publication never leaves a tag behind. In return:

  • Branch up to date: when the commit is pushed, relizy fetches the upstream branch during the checks and again right before publishing. If commits landed on it meanwhile, the release stops before publishing and restores the release files: run it again from the latest commit. --dry-run stops too, except on a pull request or a merge request, where it only warns: the commits pushed after it started get their own run. Skipped on a detached HEAD or a branch without upstream.
  • Existing tags: right after the bump, the release fails if a tag it would create already exists, and tells how to recover.
  • Rejected push: if the push is still rejected because the remote branch moved, relizy merges the remote branch into the release commit (the tags stay on the published commit) and pushes again. On a conflict, it aborts the merge, pushes the tags and prints the recovery command.
  • Failed publication: the files written by the release are restored.

Options ​

FlagDescriptionConfig
--major, --minor, --patchForce the bump type of the releasebump.type
--prerelease, --premajor, --preminor, --prepatchBump to a prerelease version, see Prerelease Versionsbump.type
--preid <id>Prerelease identifier: alpha, beta, rc...bump.preid
--suffix <suffix>With a prerelease type, replace the last number: 1.0.0-beta.0 becomes 1.0.0-beta.<suffix>bump.suffix
--canaryPublish a canary version of the current commit, see Canaryrelease.canary
--forceBump the packages even without a commit triggering a bump-
--yesConfirm the new versions without asking. Required without an interactive terminal (CI)bump.yes
--from <ref>Start of the commit range (tag or commit), instead of the last release tagfrom
--to <ref>End of the commit range, HEAD by defaultto
--no-cleanRelease with uncommitted changes. In a terminal, asks to confirm when they touch a file the release commitsrelease.clean
--private-packages <mode>release: version the private packages too (never published), ignore: leave them outmonorepo.privatePackages
--no-changelogDo not write the changelogsrelease.changelog
--format-cmd <cmd>Command run after writing the changelogs, {{files}} replaced by their pathschangelog.formatCmd
--no-format-cmdDo not format the changelogs (no formatter detected)changelog.formatCmd: false
--no-root-changelogDo not write the root CHANGELOG.md of a monorepochangelog.rootChangelog
--no-publishDo not publish the packagesrelease.publish
--build-cmd <cmd>Command run before publishing, e.g. "pnpm build" (quoted: it is one argument)publish.buildCmd
--registry <url>Registry to publish to: every package goes there, on top of its non-exclusive publish.registries entriespublish.registry
--tag <tag>Dist-tag of the publication. Default: latest for a stable version, next for a prereleasepublish.tag
--access <type>public or restrictedpublish.access
--otp <code>One-time password of the registry (2FA)publish.otp
--publish-token <token>Registry token, for npm, pnpm and buntokens.registry
--skip-existing-versionsSkip the packages whose version is already on the registry instead of failingpublish.skipExistingVersions
--no-commitDo not commit, tag nor pushrelease.commit
--no-git-tagDo not create the tagsrelease.gitTag
--no-verifyCommit with git commit --no-verify (skip the git hooks)release.noVerify
--no-pushDo not push the commit and the tagsrelease.push
--no-provider-releaseDo not create the GitHub or GitLab releasesrelease.providerRelease
--provider <provider>Git provider: github or gitlabrepo
--token <token>Token of the git provider (GitHub or GitLab)tokens
--ai, --no-aiForce or disable the AI rewrite of the release notes and the social postsAI
--no-socialDo not post on social mediarelease.social
--slack-format <format>full (bodies and PR links), summary (commit titles) or none changelog in the Slack messagesocial.slack
--sync <branch...>Merge the released branch into these branches, instead of the rules of syncsync.rules
--no-syncDo not merge the released branch into the branches of sync.rulesrelease.sync
--sync-mode <mode>push the branches, or open a pull-request into each onesync.mode
--no-pr-commentDo not comment the pull requestrelease.prComment
--pr-comment-mode <mode>update the comment, append a new one, or recreate it at the bottom of the pull requestprComment.mode
--report-json <file>Write the report of the release to this JSON filerelease.report
--report-dotenv <file>Write the outputs of the release to this dotenv file (RELIZY_RELEASED=true...), for GitLab CIrelease.report
--report-markdown <file>Write the summary of the release to this markdown filerelease.report

On GitHub Actions, the outputs of the step and the summary of the run are written without option.

Canary ​

--canary publishes a temporary version of the current commit, {nextVersion}-0.canary-{sha} (e.g. 1.3.0-0.canary-a3f4b2c), with the canary dist-tag:

  • it skips the changelog, the commit, the tags, the push, the provider release and the social posts;
  • it keeps the checks, the publication and the PR comment;
  • it restores the package.json files once published (right away with --no-publish);
  • the version comes from the commits: the type flags, --force and --suffix are ignored;
  • --preid changes the identifier (1.3.0-0.snapshot-a3f4b2c), --tag the dist-tag, --skip-existing-versions makes a re-run on the same commit succeed.

See Canary Releases.

Examples ​

bash
# Preview: versions, changelogs, release notes, posts
relizy release --dry-run

# In CI
relizy release --yes

# A beta prerelease, published with the next dist-tag
relizy release --prerelease --preid beta --yes

# Version and tag, publish nothing
relizy release --no-publish --no-provider-release

# Canary of a pull request
relizy release --canary --yes --pr-number 42

# GitLab CI: the outputs for the next jobs
relizy release --yes --report-dotenv relizy.env

# Release main, then merge it into develop
relizy release --yes --sync develop

See Also ​