File tree Expand file tree Collapse file tree 2 files changed +22
-13
lines changed
Expand file tree Collapse file tree 2 files changed +22
-13
lines changed Original file line number Diff line number Diff line change 1313 if : tag IS present
1414 before_script :
1515 - cp ./.travis/settings.xml $HOME/.m2
16- - ls $HOME/.m2
17- - cat $HOME/.m2/settings.xml
1816 script :
1917 - mvn deploy -B
18+ - ls target
2019 deploy :
2120 provider : releases
2221 api_key : $GITHUB_TOKEN
2524 skip_cleanup : true
2625 on :
2726 tags : true
28- after_deploy :
29- - bash scripts/setup_git.sh
30- - bash scripts/prepare_snapshot.sh
3127
3228cache :
3329 directories :
Original file line number Diff line number Diff line change 2121 tag=$DEFAULT_TAG
2222fi
2323
24- # Extracting project name from POM and deducing release name
25- PROJECT_NAME=$( mvn help:evaluate -Dexpression=project.name -q -DforceStdout)
26- DEFAULT_NAME=" $PROJECT_NAME $version "
24+ # Deduce next development version
25+ SPLIT_VERSION=${version// ./ }
26+ IFS=' '
27+ read -ra SPLIT_VERSION <<< " $SPLIT_VERSION"
28+ NEW_MINOR=$( expr ${SPLIT_VERSION[1]} + 1 )
29+ DEFAULT_SNAPSHOT=" ${SPLIT_VERSION[0]} .$NEW_MINOR -SNAPSHOT"
2730
28- echo -n " Release name ? ($DEFAULT_NAME ) : " ; read name
29- if [ -z $name ]
31+ echo -n " Next development version ? ($DEFAULT_SNAPSHOT ) : " ; read snapshot
32+ if [ -z $snapshot ]
3033then
31- name= $DEFAULT_NAME
34+ snapshot= $DEFAULT_SNAPSHOT
3235fi
3336
34- echo " Preparing release $version as \" $name \" with tag $tag "
37+ echo " Preparing release $version with tag $tag "
3538
3639set -x
3740
@@ -48,5 +51,15 @@ git commit -m "Prepare release $version"
4851git push
4952
5053# Tag release
51- git tag -a $tag -m " $name "
54+ git tag $tag
5255git push --tags
56+
57+ echo " Preparing next release $version with tag $tag "
58+
59+ # Set the next development version in POM file
60+ mvn versions:set -DnewVersion=$snapshot
61+
62+ # Commit new POM
63+ git add .
64+ git commit -m " Prepare for next development version $snapshot "
65+ git push
You can’t perform that action at this time.
0 commit comments