Skip to content

Commit 569f45a

Browse files
committed
Releasing 1.0.0-rc.1
1 parent 369b05a commit 569f45a

File tree

5 files changed

+199
-17
lines changed

5 files changed

+199
-17
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ To import the NdArray library in your project, simply add the following dependen
1111
<dependency>
1212
<groupId>org.tensorflow</groupId>
1313
<artifactId>ndarray</artifactId>
14-
<version>0.4.0</version>
14+
<version>1.0.0-rc.1</version>
1515
</dependency>
1616
```
1717

RELEASE.md

+179
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# Releasing NdArray Java Library
2+
3+
The
4+
[NdArray Java Library](https://github.com/tensorflow/java-ndarray) is available on Maven Central and JCenter
5+
through artifacts uploaded to
6+
[OSS Sonatype](https://oss.sonatype.org/content/repositories/releases/org/tensorflow/). This
7+
document describes the process of updating the release artifacts. It does _not_ describe how to use
8+
the artifacts, for which the reader is referred to the
9+
[NdArray Java Library installation instructions](https://github.com/tensorflow/java-ndarray/blob/main/README.md).
10+
11+
## Release process overview
12+
13+
NdArray Java Library must be conducted locally in a [Docker](https://www.docker.com) container for a hermetic release process.
14+
15+
It is important to note that any change pushed to a release branch (i.e. a branch prefixed
16+
by `r`) will start a new release workflow. Therefore, these changes should always increment the
17+
version number.
18+
19+
### Pre-requisites
20+
21+
- `docker`
22+
- An account at [oss.sonatype.org](https://oss.sonatype.org/), that has
23+
permissions to update artifacts in the `org.tensorflow` group. If your
24+
account does not have permissions, then you'll need to ask someone who does
25+
to [file a ticket](https://issues.sonatype.org/) to add to the permissions
26+
([sample ticket](https://issues.sonatype.org/browse/MVNCENTRAL-1637)).
27+
- A GPG signing key, required
28+
[to sign the release artifacts](http://central.sonatype.org/pages/apache-maven.html#gpg-signed-components).
29+
30+
### Preparing a release
31+
32+
#### Major or minor release
33+
34+
1. Get a clean version of the source code by cloning the
35+
[NdArray Java Library GitHub repository](https://github.com/tensorflow/java-ndarray)
36+
```
37+
git clone https://github.com/tensorflow/java-ndarray
38+
```
39+
2. Create a new branch for the release named `r<MajorVersion>.<MinorVersion>`
40+
```
41+
git checkout -b r1.0
42+
```
43+
3. Update the version of the Maven artifacts to the full version of the release
44+
```
45+
mvn versions:set -DnewVersion=1.0.0
46+
```
47+
4. Update the NdArray Java Library version to reflect the new release at the following locations:
48+
- https://github.com/tensorflow/java-ndarray/blob/main/README.md#introduction
49+
50+
5. Commit the changes and push the branch to the GitHub repository
51+
```
52+
git add .
53+
git commit -m "Releasing 1.0.0"
54+
git push --set-upstream origin r1.0
55+
```
56+
57+
#### Patch release
58+
59+
1. Get a clean version of the source code by cloning the
60+
[NdArray Java Library GitHub repository](https://github.com/tensorflow/java-ndarray)
61+
```
62+
git clone https://github.com/tensorflow/java-ndarray
63+
```
64+
2. Switch to the release branch of the version to patch
65+
```
66+
git checkout r1.0
67+
```
68+
3. Patch the code with your changes. For example, changes could be merged from another branch you
69+
were working on or be applied directly to this branch when the required changes are minimal.
70+
71+
4. Update the version of the Maven artifacts to the full version of the release
72+
```
73+
mvn versions:set -DnewVersion=1.0.1
74+
```
75+
5. Update the NdArray Java Library version to reflect the new release at the following locations:
76+
- https://github.com/tensorflow/java-ndarray/blob/main/README.md#introduction
77+
78+
6. Commit the changes and push the branch to the GitHub repository
79+
```
80+
git add .
81+
git commit -m "Releasing 1.0.1"
82+
git push
83+
```
84+
85+
### Performing the release
86+
87+
1. At the root of your repository copy, create a Maven settings.xml file with your OSSRH credentials and
88+
your GPG key passphrase:
89+
```sh
90+
SONATYPE_USERNAME="your_sonatype.org_username_here"
91+
SONATYPE_PASSWORD="your_sonatype.org_password_here"
92+
GPG_PASSPHRASE="your_gpg_passphrase_here"
93+
cat > settings.xml <<EOF
94+
<settings>
95+
<servers>
96+
<server>
97+
<id>ossrh</id>
98+
<username>${SONATYPE_USERNAME}</username>
99+
<password>${SONATYPE_PASSWORD}</password>
100+
</server>
101+
<server>
102+
<id>ossrh-staging</id>
103+
<username>${SONATYPE_USERNAME}</username>
104+
<password>${SONATYPE_PASSWORD}</password>
105+
</server>
106+
</servers>
107+
<profiles>
108+
<profile>
109+
<activation>
110+
<activeByDefault>true</activeByDefault>
111+
</activation>
112+
<properties>
113+
<gpg.executable>gpg2</gpg.executable>
114+
<gpg.passphrase>${GPG_PASSPHRASE}</gpg.passphrase>
115+
</properties>
116+
</profile>
117+
<profiles>
118+
</settings>
119+
EOF
120+
```
121+
2. Execute the `release.sh` script. This will sign and deploy artifacts on OSS Sonatype.
122+
123+
On success, the released artifacts are uploaded to the private staging repository in OSS Sonatype (check at the Maven
124+
build output to know the exact location of the staging repository). After inspecting the artifacts in OSS Sonatype, you
125+
should release or drop them.
126+
127+
Visit https://oss.sonatype.org/#stagingRepositories, find the `orgtensorflow-*`
128+
of your release and click `Close` and `Release` to finalize the release. You always have the option
129+
to `Drop` it to abort and restart if something went wrong.
130+
131+
3. Go to GitHub and create a release tag on the release branch with a summary of what the version includes.
132+
133+
Some things of note:
134+
- For details, look at the [Sonatype guide](http://central.sonatype.org/pages/releasing-the-deployment.html).
135+
- Syncing with [Maven Central](http://repo1.maven.org/maven2/org/tensorflow/)
136+
can take 10 minutes to 2 hours (as per the [OSSRH guide](http://central.sonatype.org/pages/ossrh-guide.html#releasing-to-central)).
137+
138+
### Finishing a release
139+
140+
#### Major or minor release
141+
142+
1. Checkout the main branch and merge back changes from the released branch
143+
```
144+
git checkout main
145+
git merge r1.0
146+
```
147+
2. In your local copy, checkout the main branch and increase the next snapshot version.
148+
```
149+
mvn versions:set -DnewVersion=1.1.0-SNAPSHOT
150+
```
151+
3. Update the NdArray Java Library version to reflect the new release at the following locations:
152+
- https://github.com/tensorflow/java-ndarray/blob/main/README.md#introduction
153+
154+
4. Commit your changes and push the main branch to the GitHub repository
155+
```
156+
git add .
157+
git commit -m "Increase version for next iteration"
158+
git push
159+
```
160+
161+
#### Patch release
162+
163+
1. Checkout the main branch and merge back changes from the released branch, preserving current snapshot version
164+
```
165+
git checkout main
166+
git merge r1.0
167+
```
168+
2. Commit the main and push the main branch to the GitHub repository
169+
```
170+
git add .
171+
git commit -m "Merge release 1.0.1"
172+
git push
173+
```
174+
175+
## References
176+
177+
- [Sonatype guide](http://central.sonatype.org/pages/ossrh-guide.html) for
178+
hosting releases.
179+
- [Ticket that created the `org/tensorflow` configuration](https://issues.sonatype.org/browse/OSSRH-28072) on OSSRH.

ndarray/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.tensorflow</groupId>
2424
<artifactId>tensorflow-java-ndarray</artifactId>
25-
<version>0.5.0-SNAPSHOT</version>
25+
<version>1.0.0-rc.1</version>
2626
</parent>
2727
<artifactId>ndarray</artifactId>
2828
<packaging>jar</packaging>

pom.xml

+17-14
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>org.tensorflow</groupId>
77
<artifactId>tensorflow-java-ndarray</artifactId>
8-
<version>0.5.0-SNAPSHOT</version>
8+
<version>1.0.0-rc.1</version>
99
<packaging>pom</packaging>
1010

1111
<name>NdArray Parent</name>
@@ -56,6 +56,7 @@
5656
</snapshots>
5757
</repository>
5858
</repositories>
59+
5960
<pluginRepositories>
6061
<pluginRepository>
6162
<id>ossrh-snapshots</id>
@@ -125,19 +126,21 @@
125126
<properties>
126127
<gpg.skip>false</gpg.skip>
127128
</properties>
128-
<repositories>
129-
<repository>
130-
<id>ossrh-staging</id>
131-
<name>OSSRH Sonatype Staging</name>
132-
<url>https://oss.sonatype.org/service/local/staging/deployByRepositoryId/${stagingRepositoryId}/</url>
133-
<releases>
134-
<enabled>true</enabled>
135-
</releases>
136-
<snapshots>
137-
<enabled>false</enabled>
138-
</snapshots>
139-
</repository>
140-
</repositories>
129+
<build>
130+
<plugins>
131+
<plugin>
132+
<groupId>org.sonatype.plugins</groupId>
133+
<artifactId>nexus-staging-maven-plugin</artifactId>
134+
<version>1.6.8</version>
135+
<extensions>true</extensions>
136+
<configuration>
137+
<serverId>ossrh</serverId>
138+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
139+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
140+
</configuration>
141+
</plugin>
142+
</plugins>
143+
</build>
141144
</profile>
142145

143146
<profile>

release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ CMD="$*"
2727
# To get a shell to poke around the maven artifacts with.
2828
if [[ -z "${CMD}" ]]
2929
then
30-
CMD="mvn clean deploy -B -e --settings ./settings.xml -Pdeploying -Preleasing"
30+
CMD="mvn clean deploy -B -e --settings ./settings.xml -Preleasing"
3131
fi
3232

3333
export GPG_TTY=$(tty)

0 commit comments

Comments
 (0)