-
Notifications
You must be signed in to change notification settings - Fork 132
/
release.sh
executable file
·91 lines (72 loc) · 3.84 KB
/
release.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/sh
set -e
: ${RELEASE_VERSION?"Need to set env var RELEASE_VERSION, e.g. 2.0.0"}
: ${DEVELOPMENT_VERSION?"Need to set env var DEVELOPMENT_VERSION for next development version, e.g. 2.1.0 (don't include SNAPSHOT)"}
export RELEASE_VERSION=$RELEASE_VERSION
export DEVELOPMENT_VERSION=$DEVELOPMENT_VERSION
export TIMESTAMP=`date +"%Y%m%d%H%M"`
#
# release compiler/ and dist/
#
mvn --batch-mode -Dtag=robovm-$RELEASE_VERSION -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION-SNAPSHOT release:prepare
mvn --batch-mode -Dtag=robovm-$RELEASE_VERSION -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION-SNAPSHOT release:perform
#
# release plugins/eclipse
#
cd plugins/eclipse
# Set the pom version to the release version
mvn org.eclipse.tycho:tycho-versions-plugin:1.5.1:set-version -DnewVersion="$RELEASE_VERSION.$TIMESTAMP"
mv pom.xml pom.xml.bak && sed "s/<robovm.version>.*<\/robovm.version>/<robovm.version>$RELEASE_VERSION<\/robovm.version>/" pom.xml.bak > pom.xml
# Create the update site for the release version
mvn clean install
git commit -am "Set release version of Eclipse plugin, $RELEASE_VERSION"
git push
# Copy the update-site/target/ to whereever you want it
ssh [email protected] "mkdir -p /usr/share/nginx/html/downloads/releases/eclipse/$RELEASE_VERSION"
scp -r update-site/target/repository/ [email protected]:/usr/share/nginx/html/downloads/releases/eclipse/$RELEASE_VERSION/
# Set the pom version to the next development version
mvn org.eclipse.tycho:tycho-versions-plugin:1.5.1:set-version -DnewVersion="$DEVELOPMENT_VERSION-SNAPSHOT"
mv pom.xml pom.xml.bak && sed "s/<robovm.version>.*<\/robovm.version>/<robovm.version>$DEVELOPMENT_VERSION-SNAPSHOT<\/robovm.version>/" pom.xml.bak > pom.xml
rm pom.xml.bak
git commit -am "Set next development version of Eclipse plugin, $DEVELOPMENT_VERSION"
git push
#
# release plugins/idea
#
cd ../idea
# Set the gradle version to the release version
sed "s/^version *=.*/version = '$RELEASE_VERSION'/" build.gradle | sed "s/roboVMVersion *=.*/roboVMVersion = '$RELEASE_VERSION'/" > build.gradle.tmp
mv build.gradle.tmp build.gradle
# Create the plugin Zip for the release version
./gradlew clean buildPlugin
git commit -am "Set release version of IDEA plugin, $RELEASE_VERSION"
git push
# Copy the target/*-dist.jar to whereever you want it
scp build/distributions/idea-$RELEASE_VERSION.zip [email protected]:/usr/share/nginx/html/downloads/releases/idea
# Set the pom version to the next development version (it always have to be development)
mvn versions:set -DnewVersion=$DEVELOPMENT_VERSION-SNAPSHOT
mvn versions:commit
mv pom.xml pom.xml.bak && sed "s/<robovm.version>.*<\/robovm.version>/<robovm.version>$DEVELOPMENT_VERSION-SNAPSHOT<\/robovm.version>/" pom.xml.bak > pom.xml
rm pom.xml.bak
# Set the gradle version to the next development version
sed "s/^version *=.*/version = '$DEVELOPMENT_VERSION-SNAPSHOT'/" build.gradle | sed "s/roboVMVersion *=.*/roboVMVersion = '$DEVELOPMENT_VERSION-SNAPSHOT'/" > build.gradle.tmp
mv build.gradle.tmp build.gradle
git commit -am "Set next development version of IDEA plugin, $DEVELOPMENT_VERSION"
git push
#
# Publish Gradle plugin
#
cd ../gradle
# Set release version
sed "s/^version *=.*/version = '$RELEASE_VERSION'/" build.gradle | sed "s/roboVMVersion *=.*/roboVMVersion = '$RELEASE_VERSION'/" > build.gradle.tmp
mv build.gradle.tmp build.gradle
./gradlew clean build
git commit -am "Set release version of Gradle plugin, $RELEASE_VERSION"
git push
# Release
./gradlew publish
# Set development version
sed "s/^version *=.*/version = '$DEVELOPMENT_VERSION-SNAPSHOT'/" build.gradle | sed "s/roboVMVersion *=.*/roboVMVersion = '$DEVELOPMENT_VERSION-SNAPSHOT'/" > build.gradle.tmp
mv build.gradle.tmp build.gradle
git commit -am "Set next development version of Gradle plugin, $DEVELOPMENT_VERSION-SNAPSHOT"
git push