File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 <modelVersion >4.0.0</modelVersion >
44 <artifactId >cohort-requester</artifactId >
55 <groupId >fr.aphp.id.eds</groupId >
6- <version >2.10.0 </version >
6+ <version >2.11.0-SNAPSHOT </version >
77 <packaging >jar</packaging >
88 <name >Cohort Requester</name >
99 <description />
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
6+
7+
8+ # Check if the version is a new minor release (x.y.0)
9+ if [[ $VERSION =~ ^([0-9]+)\. ([0-9]+)\. 0$ ]]; then
10+ MAJOR=${BASH_REMATCH[1]}
11+ MINOR=${BASH_REMATCH[2]}
12+ NEXT_MINOR_VERSION=" $MAJOR .$(( MINOR + 1 )) .0-SNAPSHOT"
13+
14+ echo " Preparing for next development version: $NEXT_MINOR_VERSION "
15+
16+ # Update version in pom.xml to the next minor version
17+ mvn versions:set -DnewVersion=$NEXT_MINOR_VERSION
18+
19+ echo " You can review the modification and then execute this command to commit and push the changes:"
20+ echo " git add pom.xml && git commit -m \" build: prepare for next development version $NEXT_MINOR_VERSION \" && git push origin HEAD"
21+
22+ read -p " Would you like to automatically execute these commands? (y/N) " answer
23+ if [ " $answer " = " y" ]; then
24+ # Add files and create commit
25+ git add .
26+ git commit -m " build: prepare for next development version $NEXT_MINOR_VERSION "
27+ git push origin HEAD
28+ echo " Next development version set and pushed successfully."
29+ else
30+ echo " Next development version not set."
31+ fi
32+ else
33+ echo " Version $VERSION is not a new minor release. Skipping next development version setup."
34+ fi
Original file line number Diff line number Diff line change @@ -42,4 +42,34 @@ if [ "$answer" = "y" ]; then
4242 echo " Release commit created and pushed successfully."
4343else
4444 echo " Release commit not created."
45+ exit 0
46+ fi
47+
48+ # Prepare for next development version
49+ # Check if the version is a new minor release (x.y.0)
50+ if [[ $VERSION =~ ^([0-9]+)\. ([0-9]+)\. 0$ ]]; then
51+ MAJOR=${BASH_REMATCH[1]}
52+ MINOR=${BASH_REMATCH[2]}
53+ NEXT_MINOR_VERSION=" $MAJOR .$(( MINOR + 1 )) .0-SNAPSHOT"
54+
55+ echo " Preparing for next development version: $NEXT_MINOR_VERSION "
56+
57+ # Update version in pom.xml to the next minor version
58+ mvn versions:set -DnewVersion=$NEXT_MINOR_VERSION
59+
60+ echo " You can review the modification and then execute this command to commit and push the changes:"
61+ echo " git add pom.xml && git commit -m \" build: prepare for next development version $NEXT_MINOR_VERSION \" && git push origin HEAD"
62+
63+ read -p " Would you like to automatically execute these commands? (y/N) " answer
64+ if [ " $answer " = " y" ]; then
65+ # Add files and create commit
66+ git add .
67+ git commit -m " build: prepare for next development version $NEXT_MINOR_VERSION "
68+ git push origin HEAD
69+ echo " Next development version set and pushed successfully."
70+ else
71+ echo " Next development version not set."
72+ fi
73+ else
74+ echo " Version $VERSION is not a new minor release. Skipping next development version setup."
4575fi
You can’t perform that action at this time.
0 commit comments