Skip to content

Commit c7e6f3c

Browse files
authored
Implement auto-pom version bump (#84)
* Implement auto-pom version bump * Remove SNAPSHOT from version number --------- Co-authored-by: Madhavan Sridharan <[email protected]>
1 parent 8ff34f8 commit c7e6f3c

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

.github/workflows/maven.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@ jobs:
2525
cache: maven
2626
- name: Build with Maven
2727
run: mvn -B package --file pom.xml
28-
28+
29+
- name: bump minor version
30+
run: |
31+
scripts/bump_minor_version

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
<groupId>datastax.astra.migrate</groupId>
55
<artifactId>cassandra-data-migrator</artifactId>
6-
<version>3.1.0</version>
6+
<version>${revision}</version>
77
<packaging>jar</packaging>
88

99
<properties>
1010
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11+
<revision>3.1.0</revision>
1112
<scala.version>2.12.17</scala.version>
1213
<scala.main.version>2.12</scala.main.version>
1314
<spark.version>3.3.1</spark.version>

scripts/bump_minor_version

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -x
3+
CURRENT_VERSION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout)
4+
RELEASE_VERSION=${CURRENT_VERSION%%}
5+
BASE_VERSION=$(echo "$RELEASE_VERSION" | cut -d'.' -f1-2)
6+
MINOR_VERSION=$(echo "$RELEASE_VERSION" | cut -d'.' -f3)
7+
NEXT_MINOR_VERSION=$(( $MINOR_VERSION + 1 ))
8+
NEXT_SNAPSHOT="${BASE_VERSION}.${NEXT_MINOR_VERSION}"
9+
printf "next-snapshot: %s\n" "${NEXT_SNAPSHOT}"
10+
mvn versions:set-property -DallowSnapshots -DnewVersion="${NEXT_SNAPSHOT}" -Dproperty=revision

0 commit comments

Comments
 (0)