Dashboard › cli › Distillation
c13505f5-7f79-4bb7-a632-2148ce5303d8["lore_tm_v1_RxqqMhMhIc_YPeyZH_bJ1upOjy5u0RrcSRbwm9dRcWY","lore_tm_v1_vFuJBlXx-Z4p2J9ouNB-RsBBifZTT89PpIb-tpyQg1w","lore_tm_v1_lqzb-BU5V17Skg3Oy2PBt57-zNiQqGAVdRlq05gOHkM"]
prepare [NEW-VERSION] command has aliases p, prerelease, prepublish, prepare, and release; its description is 🚢 Prepare a new release branch. DEFAULT_BUMP_VERSION_PATH = join('scripts', 'bump-version.sh'), AUTO_VERSION_MIN_VERSION = '2.14.0', AUTO_BUMP_MIN_VERSION = '2.21.0', and SLEEP_BEFORE_PUBLISH_SECONDS = 30.prepare accepts positional NEW-VERSION as an explicit semver, major, minor, patch, auto, or calver; when omitted, it uses versioning.policy from .craft.yml. Options include --rev/-r, --no-push, --no-git-checks, --no-changelog, --publish, --remote (default origin), --config-from, and --calver-offset.createReleaseBranch() constructs ${releaseBranchPrefix || DEFAULT_RELEASE_BRANCH_NAME}/${newVersion}, checks it with git.raw('show-ref', '--heads', branchName), and reports deletion commands git branch -D ${branchName}; git push ${remoteName} --delete ${branchName} if it already exists. Otherwise it runs git.checkoutBranch(branchName, rev), logs Created a new release branch: "${branchName}", then logs Switched to branch "${branchName}".pushReleaseBranch() pushes with git.push(remoteName, branchName, ['--set-upstream']); when pushing is disabled, it prints the later command git push -u ${remoteName} "${branchName}".commitChanges() stages with --all when a pre-release command ran so version files, lock files, and other touched files are included. Without a pre-release command, it commits only explicitly staged files such as the changelog, ensuring stray working-tree changes are never swept in by accident.relative('', changelogPath), rejects paths whose relative form starts with ., and creates a missing file containing # Changelog\n only under ChangelogPolicy.Auto; other policies raise Changelog does not exist: "${changelogPath}".prepareMain() supports --config-from by fetching [argv.remote, argv.configFrom], reading ${argv.remote}/${argv.configFrom}:${CONFIG_FILE_NAME}, obtaining the repository root via git.revparse(['--show-toplevel']), and calling loadConfigurationFromString(configContent, repositoryRoot.trim()). It warns that the remote branch must be trusted because its preReleaseCommand will be executed by Craft.prepareMain() resolves rev as argv.rev || repoStatus.current || defaultBranch, resolves the release through resolveVersion(), emits the GitHub Actions version output, and prompts for confirmation when releasing from a non-default branch without an explicit --rev.createDryRunIsolation(git, rev), creates and checks out the release branch, and only then calls getLatestTag(git, getGitTagPrefix()); the ordering is mandatory because a custom revision may be used and the latest tag must be determined immediately before that revision.prepareMain() calls commitChanges(git, newVersion, preReleaseCommandRan), displays the isolation diff, pushes unless argv.noPush, and emits GitHub Actions outputs branch, sha, and previous_tag.@-mentions with bold formatting via disableChangelogMentions(changelogBody) to avoid notifying many contributors on regular-cadence releases. The committed CHANGELOG.md retains the original @-mentions because they do not create notifications there.writeGitHubActionsFile('changelog', issueChangelog) rather than expanded into an environment variable, avoiding Linux’s approximately 2 MB ARG_MAX/E2BIG limit for large changelogs such as Sentry’s monthly releases.https://github.com/${githubConfig.owner}/${githubConfig.repo}/blob/${branchName}/${resolvedChangelogPath}${lineRange}. The legacy step output is retained but truncated through truncateForOutput(issueChangelog, changelogFileUrl).https://github.com/${githubConfig.owner}/${githubConfig.repo}/compare/${branchName}. In isolated dry-run mode, --publish logs [dry-run] Would run: craft publish ${newVersion}; otherwise it reports the branch pushed and calls execPublish(argv.remote, newVersion, argv.noGitChecks).getGitClient() uses getConfigFileDir() || '.', changes the process working directory to that location, constructs simpleGit(configFileDir), verifies git.checkIsRepo(), throws ConfigurationError('Not in a git repository!') outside a repository, and returns the client wrapped by createDryRunGit(git).bun.lock always uses forward slashes even on Windows."version" always precedes any { and is therefore reachable under the parser’s stated search constraint; this ordering is relied upon to avoid corrupting the version line.