diff --git a/CHANGELOG.md b/CHANGELOG.md index 39434c1..2a7ee00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ # Next version (unreleased) -Adding a cli \ No newline at end of file +PUT_CHANGELOG_HERE + +# Version 0.0.3 +_2024-06-19_ + +Adding a cli diff --git a/core/src/main/kotlin/com/gradleup/librarian/core/tooling/release.kt b/core/src/main/kotlin/com/gradleup/librarian/core/tooling/release.kt index d7ea1b7..869250b 100644 --- a/core/src/main/kotlin/com/gradleup/librarian/core/tooling/release.kt +++ b/core/src/main/kotlin/com/gradleup/librarian/core/tooling/release.kt @@ -1,7 +1,6 @@ package com.gradleup.librarian.core.tooling import java.io.File -import kotlin.system.exitProcess internal fun checkCwd() { File(".git").apply { @@ -22,20 +21,19 @@ fun commitRelease(versionToRelease: String) { "Version '${getCurrentVersion()} is not a -SNAPSHOT, check your working directory" } - if (runCommand("git", "status", "--porcelain").isNotEmpty()) { - println("Your git repo is not clean. Make sure to stash or commit your changes before making a release") - exitProcess(1) + check (runCommand("git", "status", "--porcelain").isEmpty()) { + "Your git repo is not clean. Make sure to stash or commit your changes before making a release" } - processChangelog(versionToRelease) - val startBranch = runCommand("git", "symbolic-ref", "--short", "HEAD") check(startBranch == "main" || startBranch.startsWith("release-")) { "You must be on the main branch or a release branch to make a release" } + processChangelog(versionToRelease) + // 'De-snapshot' the version, open a PR, and merge it - val releaseBranchName = "release-$versionToRelease" + val releaseBranchName = "$versionToRelease-release" runCommand("git", "checkout", "-b", releaseBranchName) setCurrentVersion(versionToRelease) setVersionInDocs(versionToRelease) @@ -57,7 +55,7 @@ fun commitRelease(versionToRelease: String) { println("Tag pushed.") // Bump the version to the next snapshot - val bumpVersionBranchName = "release-$versionToRelease-bump-snapshot" + val bumpVersionBranchName = "$versionToRelease-bump-snapshot" runCommand("git", "checkout", "-b", bumpVersionBranchName) val nextSnapshot = getNextSnapshot(versionToRelease) diff --git a/librarian.properties b/librarian.properties index 238a854..be09f52 100644 --- a/librarian.properties +++ b/librarian.properties @@ -9,7 +9,7 @@ sonatype.host=Default git.snapshots=main pom.groupId=com.gradleup.librarian -pom.version=0.0.3-SNAPSHOT +pom.version=0.0.3 pom.description=Librarian pom.vcsUrl=https://github.com/gradleup/librarian pom.developer=GradleUp authors