forked from LibrePDF/OpenPDF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
createRelease.sh
executable file
·71 lines (59 loc) · 1.84 KB
/
createRelease.sh
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
63
64
65
66
67
68
69
70
71
#!/bin/bash
if [ "x$LIBREPDF_ORIGIN" == "x" ]
then
echo "Please set LIBREPDF_ORIGIN to the origin-name of the librepdf repository on github."
echo "This could be 'origin' or any name you declared to be that origin."
exit
fi
if [ $# -ne 1 ]
then
echo "Please give the NEXT SNAPSHOT version number (without -SNAPSHOT)"
exit
fi
VERSION=$(grep "<version>" pom.xml | head -1 | sed "s/.*<version>\([0-9.]*\)\(-SNAPSHOT\)\{0,1\}<\/version>.*/\1/")
NEW_VERSION=${1}-SNAPSHOT
cat << EOD
Will set Version to ${VERSION} and next Snapshot to ${NEW_VERSION}.
Things to do before you continue:
- Update the README.md, so the new Release is mentioned there
- Create a ChangeLog for this release
- Update the contributors and credits
Press ENTER to continue. Ctrl-C to stop.
EOD
read ignored
echo "#1. Setting release version: ${VERSION}"
mvn versions:set -DnewVersion="${VERSION}"
echo "#2. Test build"
mvn clean install
RC=$?
if [ ${RC} -ne 0 ]
then
echo "Errors. Exiting."
exit
fi
echo "#3. Commit changes and tag"
git commit -a -m "Set version to ${VERSION}" && git tag "${VERSION}"
echo "#4. Make a staging release"
mvn clean deploy
RC=$?
if [ $RC -eq 0 ]
then
cat << EOD
Staging Release seems to be created. Please review it at https://oss.sonatype.org/#stagingRepositories
if everything seems fine, hit ENTER. Else break this script with Ctrl-C.
EOD
read pause
else
echo "Something went wrong. Please switch to manual deploy."
echo "(look at https://github.com/LibrePDF/OpenPDF/wiki/Release-Process)"
exit
fi
echo "#5. Deploy release."
mvn nexus-staging:release
echo "#6. Finishing."
echo " - set next SNAPSHOT to $NEW_VERSION"
mvn versions:set -DnewVersion="$NEW_VERSION"
echo " - commit changes"
git commit -a -m "Set new Snapshot to $NEW_VERSION"
echo " - push all to github"
git push "${LIBREPDF_ORIGIN}" --tags