Skip to content

Commit 8fcb2b9

Browse files
committed
Add release scripts and instructions
1 parent 526c367 commit 8fcb2b9

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

RELEASE.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Release process
2+
3+
1. Update version string in `build.gradle` (twice), `README.md` to the final version (i.e. non-SNAPSHOT).
4+
5+
```
6+
./scripts/version.sh OLD_VERSION NEW_VERSION
7+
```
8+
9+
2. Commit "Release x.y.z", tag this commit with the new version "x.y.z".
10+
11+
```
12+
git commit -m "Release NEW_VERSION"
13+
git tag -a NEW_VERSION
14+
```
15+
16+
3. [Deploy to OSSRH with Gradle](http://central.sonatype.org/pages/gradle.html):
17+
18+
```
19+
./gradlew -Prelease uploadArchives
20+
```
21+
22+
4. [Releasing the Deployment](http://central.sonatype.org/pages/releasing-the-deployment.html):
23+
24+
```
25+
./gradlew -Prelease closeAndReleaseRepository
26+
```
27+
28+
5. Increment to next version with -SNAPSHOT suffix
29+
30+
```
31+
./scripts/version.sh OLD_VERSION NEW_VERSION-SNAPSHOT
32+
...
33+
```
34+
35+
6. Create a commit for the new version "Set version to a.b.c-SNAPSHOT"
36+
37+
```
38+
git add README.md build.gradle
39+
git commit -m "Set version to NEW_VERSION-SNAPSHOT"
40+
```
41+

scripts/version.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#/usr/bin/env sh
2+
set -eu
3+
4+
if [ "$#" -ne 2 ]; then
5+
echo "Usage: version.sh OLD_VERSION NEW_VERSION" && exit 1
6+
fi
7+
8+
OLD_VERSION=$1
9+
NEW_VERSION=$2
10+
11+
files=(
12+
"build.gradle"
13+
"README.md"
14+
)
15+
16+
for file in ${files[@]}; do
17+
sed -i '' "s/$OLD_VERSION/$NEW_VERSION/g" $file
18+
done
19+
20+

0 commit comments

Comments
 (0)