ReleaseProcess.md
The following is a step-by-step procedure for releasing a new version of Google-Gson.
Go through all open bugs and identify which will be fixed in this release. Mark all others with an appropriate release tag. Identify duplicates, and close the bugs that will never be fixed. Fix all bugs for the release, and mark them fixed.
Ensure all changelists are code-reviewed and have +1
Make sure your ${user.home}/.m2/settings.xml contains the Maven Central credentials
cd gson to the parent directory; ensure there are no open files and all changes are committed.
Run mvn release:clean
Start the release: mvn release:prepare
-SNAPSHOT to the released version, commit and create the tags. It will then change the version to -SNAPSHOT for the next release.Complete the release: mvn release:perform
Download and sanity check all files.
Do not skip this step! Once you release the staging repository, there is no going back. It will get synced with Maven Central and you will not be able to update or delete anything. Your only recourse will be to release a new version of Gson and hope that no one uses the old one.
Publish the new Gson version in the Central Portal.
Gson will now get synced to Maven Central within the next hour.
Create a GitHub release for the new version.
You can let GitHub automatically generate the description for the release, but you should edit it manually to point out the most important changes and potentially incompatible changes.
Update version references in (version might be referenced multiple times):
Note: When using the Maven Release Plugin as described above, these version references should have been replaced automatically, but verify this manually nonetheless to be on the safe side.
Optional: Create a post on the Gson Discussion Forum.
Optional: Update the release version in Wikipedia and update the current "stable" release.
Important: When aborting a release / rolling back release preparations, make sure to also revert all changes to files which were done during the release (e.g. automatic replacement of version references).
The following describes how to perform the steps of the release locally to verify that they work as desired.
[!CAUTION]
Be careful with this, these steps might be outdated or incomplete. Double-check that you are working on a copy of your local Gson Git repository and make sure you have followed all steps. To be safe you can also temporarily turn off your internet connection to avoid accidentally pushing changes to the real remote Git or Maven repository.
As an alternative to the steps described below you can instead perform a dry run, though this might not behave identical to a real release.
Make a copy of your local Gson Git repository and only work with that copy
Make sure you are on the main branch
Create a temp directory outside the Gson directory
In the following steps this will be called #gson-remote-temp#; replace this with the actual absolute file path of the directory, using only forward slashes. For example under Windows C:\my-dir becomes C:/my-dir.
Create the directory #gson-remote-temp#/git-repo
In that directory run
git init --bare --initial-branch=main .
Edit the root pom.xml of Gson
Change the <developerConnection> to
scm:git:file:///#gson-remote-temp#/git-repo
For the central-publishing-maven-plugin inside the <pluginManagement>, add the following to its <configuration>
<skipPublishing>true</skipPublishing>
If you don't want to use GPG, remove the maven-gpg-plugin entry from the 'release' profile.
There is also an entry under <pluginManagement>; you can remove that as well.
Commit the changes using Git
Change the remote repository of the Git project
<!-- Uses `txt` instead of `sh` to avoid the `#` being highlighted in some way -->git remote set-url origin file:///#gson-remote-temp#/git-repo
Push the changes
git push origin main
Now you can perform the steps of the release:
mvn release:clean
mvn release:prepare
mvn release:perform
Verify that #gson-remote-temp#/git-repo contains the desired changes
Verify that in the Gson project directory where you performed the release, the target/checkout/target/central-publishing/central-bundle.zip file contains the desired artifacts
Currently that is the artifacts for gson-parent and gson.
Afterwards delete all Gson files under ${user.home}/.m2/repository/com/google/code/gson which have been installed in your local Maven repository during the release.
Otherwise Maven might not download the real Gson artifacts with these version numbers, once they are released.
Download vogar
Put adb on your $PATH and run:
vogar --benchmark --classpath gson.jar path/to/Benchmark.java
For example, here is how to run the CollectionsDeserializationBenchmark:
export ANDROID_HOME=~/apps/android-sdk-mac_x86
export PATH=$PATH:$ANDROID_HOME/platform-tools/:$ANDROID_HOME/android-sdk-mac_x86/tools/
$VOGAR_HOME/bin/vogar \
--benchmark \
--sourcepath ../gson/src/main/java/ \
src/main/java/com/google/gson/metrics/CollectionsDeserializationBenchmark.java \
-- \
--vm "app_process -Xgc:noconcurrent,app_process"