-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreleaseToMaster.bash
executable file
·62 lines (41 loc) · 1.66 KB
/
releaseToMaster.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
#
# Copyright (c) 2021. wink.travel. All rights Reserved.
#
echo "Releasing wink-sdk-java..."
echo "Sync-ing remote master with local"
git checkout master
git pull
git checkout develop
# grab latest spec files from production servers
./downloadLatestOpenApiSpecs.bash
echo "Retrieving next version number..."
newVersion=$(npx git-changelog-command-line --print-next-version --major-version-pattern BREAKING --minor-version-pattern feat)
echo "Setting the next snapshot version to $newVersion"
mvn versions:set -DnewVersion="$newVersion" -DgenerateBackupPoms=false
git commit -a -m ":bookmark: build: Updated Open API files"
echo "Starting release process..."
mvn -B gitflow:release-start gitflow:release-finish -DskipTestProject=true
STATUS=$?
if [ $STATUS -ne 0 ]; then
echo "Something went wrong on line: ${BASH_LINENO[*]}"
exit 1
fi
echo "Release complete. Finishing up..."
echo "Pushing master to origin"
git checkout master
echo "Updating CHANGELOG.md..."
mvn git-changelog-maven-plugin:git-changelog
git commit -a -m ":memo: doc: Updated CHANGELOG.md..."
git push origin master:refs/heads/master
echo "Creating GitHub release..."
gh release create v$newVersion --notes "See CHANGELOG.md for release notes" --target master
git checkout develop
echo "Merging CHANGELOG.md from master..."
git merge master --no-edit -m ":twisted_rightwards_arrows: doc: merged CHANGELOG.md from master into develop branch" --strategy-option theirs
echo "Pushing develop to origin"
git push origin develop:refs/heads/develop
# Deprecated - Moved this to build server
#echo "Pushing snapshot artifacts to Sonatype..."
#mvn deploy -Psonatype-oss-release
echo "Release SUCCESS"