diff --git a/packages/monorepo-release/src/analyze.ts b/packages/monorepo-release/src/analyze.ts index 4617840..f122622 100644 --- a/packages/monorepo-release/src/analyze.ts +++ b/packages/monorepo-release/src/analyze.ts @@ -22,7 +22,7 @@ export async function analyze(config: Config): Promise { root: packages.rootPackage, }) - log.debug("Identifying latest tag...") + log.debug("Identifying latest tag.") const latestTag = execSync("git describe --tags --abbrev=0", { stdio: "pipe", }) @@ -31,7 +31,7 @@ export async function analyze(config: Config): Promise { log.info(`Latest tag identified: \`${bold(latestTag)}\``) - log.debug("Identifying commits since the latest tag...") + log.debug("Identifying commits since the latest tag.") // TODO: Allow passing in a range of commits to analyze and print the changelog const range = `${latestTag}..HEAD` @@ -68,11 +68,11 @@ export async function analyze(config: Config): Promise { const lastCommit = commitsSinceLatestTag[0] if (lastCommit?.parsed.raw === RELEASE_COMMIT_MSG) { - log.debug("Already released...") - return [] + log.debug("Already released.") + process.exit(0) } - log.debug("Identifying commits that modified package code...") + log.debug("Identifying commits that modified package code.") function getChangedFiles(commitSha: string) { return execSync( `git diff-tree --no-commit-id --name-only -r ${commitSha}`, @@ -95,7 +95,7 @@ export async function analyze(config: Config): Promise { `modified package code`, ) - log.debug("Identifying packages that need a new release...") + log.debug("Identifying packages that need a new release.") const packagesNeedRelease: Set = new Set() const grouppedPackages = packageCommits.reduce( diff --git a/packages/monorepo-release/src/publish.ts b/packages/monorepo-release/src/publish.ts index ed653af..6846f21 100644 --- a/packages/monorepo-release/src/publish.ts +++ b/packages/monorepo-release/src/publish.ts @@ -53,7 +53,7 @@ export async function publish(packages: PackageToRelease[], options: Config) { } if (dryRun) { - log.debug("Dry run, skip release commit...") + log.debug("Dry run, skip release commit.") } else { log.debug("Commiting.") execSync( @@ -71,10 +71,10 @@ export async function publish(packages: PackageToRelease[], options: Config) { log.debug(`Changelog generated for \`${bold(pkg.name)}\`:\n`, changelog) if (!dryRun) { - log.info(`Creating git tag...`) + log.info(`Creating git tag.`) execSync(`git tag ${gitTag}`) execSync("git push --tags") - log.info(`Creating GitHub release notes...`) + log.info(`Creating GitHub release notes.`) execSync(`gh release create ${gitTag} --notes '${changelog}'`) } } @@ -93,7 +93,7 @@ function createChangelog(pkg: PackageToRelease) { const { commits: { features, breaking, bugfixes, other }, } = pkg - log.debug(`Generating changelog for package \`${bold(pkg.name)}\`...`) + log.debug(`Generating changelog for package \`${bold(pkg.name)}\`.`) let changelog = `` changelog += listGroup("Features", features)