Skip to content

Commit

Permalink
0.0.3 release (#11)
Browse files Browse the repository at this point in the history
* Do not use release-. release- is reserved for release branches

* run checks before processing the CHANGELOG

* release 0.0.3
  • Loading branch information
martinbonnin authored Jun 19, 2024
1 parent e1f5524 commit d930d78
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Next version (unreleased)

Adding a cli
PUT_CHANGELOG_HERE

# Version 0.0.3
_2024-06-19_

Adding a cli
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.gradleup.librarian.core.tooling

import java.io.File
import kotlin.system.exitProcess

internal fun checkCwd() {
File(".git").apply {
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion librarian.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d930d78

Please sign in to comment.