Skip to content

Commit 1f6bb25

Browse files
committed
Added release setup instructions and script
1 parent f67d236 commit 1f6bb25

File tree

2 files changed

+248
-0
lines changed

2 files changed

+248
-0
lines changed

RELEASE.md

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# Releasing
2+
We already have a GPG keys for signing as well as SonaType accounts. Ask MobiDevelop for details. Below
3+
you'll find instructions on how to reproduce these things (though you'll have to publish under your
4+
own groupId for your domain).
5+
6+
## Setup GPG Key
7+
Setup a GPG keypair with a passphrase.
8+
9+
```
10+
# brew install gpg if you are on Mac OS X
11+
gpg --gen-key
12+
```
13+
14+
Then publish your public key to a keyserver (`your-key-id` is what you see after `2048D/` in the first line of `gpg --list-keys`):
15+
```
16+
gpg --keyserver pgp.mit.edu --send-key <your-key-id>
17+
```
18+
19+
If you already have a GPG keypair files, e.g. `key.pub`/`key.priv`, import them into your local key chain:
20+
21+
```
22+
gpg --import key.pub
23+
gpg --allow-secret-key-import --import key.priv
24+
```
25+
26+
## Setup SonaType Account
27+
Follow [their guide](http://central.sonatype.org/pages/ossrh-guide.html)
28+
29+
## Setup Maven
30+
You need to setup the SonaType repositories as well as the GPG passphrase in your
31+
local `~/.m2/settings.xml` file:
32+
33+
```xml
34+
<?xml version="1.0" encoding="UTF-8"?>
35+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
36+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
37+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
38+
<servers>
39+
<server>
40+
<id>sonatype-nexus-snapshots</id>
41+
<username>your-sonatype-username-here</username>
42+
<password>your-sonatype-password-here></password>
43+
</server>
44+
<server>
45+
<id>sonatype-nexus-staging</id>
46+
<username>your-sonatype-username-here</username>
47+
<password>your-sonatype-password-here></password>
48+
</server>
49+
</servers>
50+
51+
<profiles>
52+
<profile>
53+
<id>gpg</id>
54+
<properties>
55+
<gpg.executable>gpg</gpg.executable>
56+
<gpg.passphrase>your-gpg-passphrase-here</gpg.passphrase>
57+
</properties>
58+
</profile>
59+
</profiles>
60+
<activeProfiles>
61+
<activeProfile>gpg</activeProfile>
62+
</activeProfiles>
63+
</settings>
64+
```
65+
66+
## Setup Gradle
67+
Finally, create a file in `~/.gradle/gradle.properies` and add the following content:
68+
69+
```
70+
signing.keyId=<your-key-id>
71+
signing.password=<your-key-passphrase>
72+
nexusUsername=<your-sonatype-username-here>
73+
nexusPassword=<your-sonatype-password-here>
74+
```
75+
76+
This is needed to deploy the Gradle plugin to SonaType
77+
78+
## Performing the Release
79+
Before we release the plugins, we'll setup a few environment variables on the CLI:
80+
81+
```
82+
export RELEASE_VERSION=2.0.0
83+
export DEVELOPMENT_VERSION=2.1.0-SNAPSHOT
84+
export TIMESTAMP=`date +"%Y%m%d%H%M"`
85+
```
86+
87+
Next, we release the modules in `compiler/` and `dist` via the root `pom.xml`
88+
89+
```
90+
# prepare the release, swap out the version numbers! This will modify the poms, try to build everything
91+
# then commit the changed release poms, tag the master branch, set the pom versions to the next
92+
# development version, and commit those as well
93+
mvn --batch-mode -Dtag=robovm-$RELEASE_VERSION -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION-SNAPSHOT release:prepare
94+
95+
# perform the release, checks out the tag, compiles and signs the jars, and uploads them to SonaType
96+
mvn --batch-mode -Dtag=robovm-$RELEASE_VERSION -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION-SNAPSHOT release:perform
97+
```
98+
99+
Login to SonaType and release the artifacts in the staging repository. It will take a while until they are
100+
available from Maven Central and its mirrors.
101+
102+
Next, release the Eclipse plugin:
103+
104+
```
105+
cd plugins/eclipse
106+
107+
# Set the pom version to the release version
108+
mvn org.eclipse.tycho:tycho-versions-plugin:0.20.0:set-version -DnewVersion="$RELEASE_VERSION.$TIMESTAMP"
109+
mv ui/pom.xml ui/pom.xml.bak && sed "s/<robovm.version>.*<\/robovm.version>/<robovm.version>$RELEASE_VERSION<\/robovm.version>/" ui/pom.xml.bak > ui/pom.xml
110+
111+
112+
# Create the update site for the release version
113+
mvn clean install
114+
git commit -am "Set release version of Eclipse plugin, $RELEASE_VERSION"
115+
git push
116+
117+
# Copy the update-site/target/ to whereever you want it
118+
ssh [email protected] "mkdir -p /usr/share/nginx/html/downloads/releases/eclipse/$RELEASE_VERSION"
119+
scp -r update-site/target/site/ [email protected]:/usr/share/nginx/html/downloads/releases/eclipse/$RELEASE_VERSION/
120+
121+
# Set the pom version to the next development version
122+
mv ui/pom.xml.bak ui/pom.xml
123+
mvn org.eclipse.tycho:tycho-versions-plugin:0.20.0:set-version -DnewVersion="$DEVELOPMENT_VERSION-SNAPSHOT"
124+
git commit -am "Set next development version of Eclipse plugin, $DEVELOPMENT_VERSION-SNAPSHOT"
125+
git push
126+
```
127+
128+
Next, release the Gradle plugin:
129+
130+
```
131+
cd plugins/
132+
133+
# Set release version
134+
sed "s/^version *=.*/version = '$RELEASE_VERSION'/" build.gradle | sed "s/roboVMVersion *=.*/ roboVMVersion = '$RELEASE_VERSION'/" > build.gradle.tmp
135+
mv build.gradle.tmp build.gradle
136+
./gradlew clean build install
137+
git commit -am "Set release version of Gradle plugin, $RELEASE_VERSION"
138+
git push
139+
140+
# Release
141+
./gradlew uploadArchives
142+
143+
# Set development version
144+
sed "s/^version *=.*/version = '$DEVELOPMENT_VERSION-SNAPSHOT'/" build.gradle | sed "s/roboVMVersion *=.*/ roboVMVersion = '$DEVELOPMENT_VERSION-SNAPSHOT'/" > build.gradle.tmp
145+
mv build.gradle.tmp build.gradle
146+
147+
git commit -am "Set next development version of Gradle plugin, $DEVELOPMENT_VERSION-SNAPSHOT"
148+
git push
149+
```
150+
151+
Next, release the IntelliJ IDEA plugin:
152+
153+
```
154+
cd plugins/idea
155+
156+
# Set the pom version to the release version
157+
mvn versions:set -DnewVersion=$RELEASE_VERSION
158+
mvn versions:commit
159+
160+
# Create the plugin Jar for the release version
161+
mvn clean install -Pdeployment
162+
git commit -am "Set release version of IDEA plugin, $RELEASE_VERSION"
163+
git push
164+
165+
# Copy the target/*-dist.jar to whereever you want it
166+
scp target/org.robovm.idea-$RELEASE_VERSION-plugin-dist.jar [email protected]:/usr/share/nginx/html/downloads/releases/idea
167+
168+
# Set the pom version to the next development version
169+
mvn versions:set -DnewVersion=$DEVELOPMENT_VERSION
170+
mvn versions:commit
171+
git commit -am "Set next development version of IDEA plugin, $DEVELOPMENT_VERSION"
172+
git push
173+
```

release.sh

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/sh
2+
: ${RELEASE_VERSION?"Need to set env var RELEASE_VERSION, e.g. 2.0.0"}
3+
: ${DEVELOPMENT_VERSION?"Need to set env var DEVELOPMENT_VERSION for next development version, e.g. 2.1.0 (don't include SNAPSHOT)"}
4+
export RELEASE_VERSION=$RELEASE_VERSION
5+
export DEVELOPMENT_VERSION=$DEVELOPMENT_VERSION
6+
export TIMESTAMP=`date +"%Y%m%d%H%M"`
7+
8+
# release compiler/ and dist/
9+
mvn --batch-mode -Dtag=robovm-$RELEASE_VERSION -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION-SNAPSHOT release:prepare
10+
mvn --batch-mode -Dtag=robovm-$RELEASE_VERSION -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION-SNAPSHOT release:perform
11+
12+
# release plugins/eclipse
13+
cd plugins/eclipse
14+
15+
# Set the pom version to the release version
16+
mvn org.eclipse.tycho:tycho-versions-plugin:0.20.0:set-version -DnewVersion="$RELEASE_VERSION.$TIMESTAMP"
17+
mv ui/pom.xml ui/pom.xml.bak && sed "s/<robovm.version>.*<\/robovm.version>/<robovm.version>$RELEASE_VERSION<\/robovm.version>/" ui/pom.xml.bak > ui/pom.xml
18+
19+
20+
# Create the update site for the release version
21+
mvn clean install
22+
git commit -am "Set release version of Eclipse plugin, $RELEASE_VERSION"
23+
git push
24+
25+
# Copy the update-site/target/ to whereever you want it
26+
ssh [email protected] "mkdir -p /usr/share/nginx/html/downloads/releases/eclipse/$RELEASE_VERSION"
27+
scp -r update-site/target/site/ [email protected]:/usr/share/nginx/html/downloads/releases/eclipse/$RELEASE_VERSION/
28+
29+
# Set the pom version to the next development version
30+
mv ui/pom.xml.bak ui/pom.xml
31+
mvn org.eclipse.tycho:tycho-versions-plugin:0.20.0:set-version -DnewVersion="$DEVELOPMENT_VERSION-SNAPSHOT"
32+
git commit -am "Set next development version of Eclipse plugin, $DEVELOPMENT_VERSION"
33+
git push
34+
35+
# release plugins/idea
36+
cd ../idea
37+
38+
# Set the pom version to the release version
39+
mvn versions:set -DnewVersion=$RELEASE_VERSION
40+
mvn versions:commit
41+
42+
# Create the plugin Jar for the release version
43+
mvn clean install -Pdeployment
44+
git commit -am "Set release version of IDEA plugin, $RELEASE_VERSION"
45+
git push
46+
47+
# Copy the target/*-dist.jar to whereever you want it
48+
scp target/org.robovm.idea-$RELEASE_VERSION-plugin-dist.jar [email protected]:/usr/share/nginx/html/downloads/releases/idea
49+
50+
# Set the pom version to the next development version
51+
mvn versions:set -DnewVersion=$DEVELOPMENT_VERSION-SNAPSHOT
52+
mvn versions:commit
53+
git commit -am "Set next development version of IDEA plugin, $DEVELOPMENT_VERSION"
54+
git push
55+
56+
# Publish Gradle plugin
57+
cd ../gradle
58+
59+
# Set release version
60+
sed "s/^version *=.*/version = '$RELEASE_VERSION'/" build.gradle | sed "s/roboVMVersion *=.*/ roboVMVersion = '$RELEASE_VERSION'/" > build.gradle.tmp
61+
mv build.gradle.tmp build.gradle
62+
./gradlew clean build install
63+
git commit -am "Set release version of Gradle plugin, $RELEASE_VERSION"
64+
git push
65+
66+
# Release
67+
./gradlew uploadArchives
68+
69+
# Set development version
70+
sed "s/^version *=.*/version = '$DEVELOPMENT_VERSION-SNAPSHOT'/" build.gradle | sed "s/roboVMVersion *=.*/ roboVMVersion = '$DEVELOPMENT_VERSION-SNAPSHOT'/" > build.gradle.tmp
71+
mv build.gradle.tmp build.gradle
72+
73+
git commit -am "Set next development version of Gradle plugin, $DEVELOPMENT_VERSION-SNAPSHOT"
74+
git push
75+

0 commit comments

Comments
 (0)