xref: /aosp_15_r20/external/gson/ReleaseProcess.md (revision a8de600362638ea28fd6cb3225451dc706d269bb)
1*a8de6003SAndroid Build Coastguard Worker# Gson Release Process
2*a8de6003SAndroid Build Coastguard Worker
3*a8de6003SAndroid Build Coastguard WorkerThe following is a step-by-step procedure for releasing a new version of Google-Gson.
4*a8de6003SAndroid Build Coastguard Worker
5*a8de6003SAndroid Build Coastguard Worker1. 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.
6*a8de6003SAndroid Build Coastguard Worker1. Ensure all changelists are code-reviewed and have +1
7*a8de6003SAndroid Build Coastguard Worker1. `cd gson` to the parent directory; ensure there are no open files and all changes are committed.
8*a8de6003SAndroid Build Coastguard Worker1. Run `mvn release:clean`
9*a8de6003SAndroid Build Coastguard Worker1. Start the release: `mvn release:prepare`
10*a8de6003SAndroid Build Coastguard Worker    - Answer questions: usually the defaults are fine. Try to follow [Semantic Versioning](https://semver.org/) when choosing the release version number.
11*a8de6003SAndroid Build Coastguard Worker    - This will do a full build, change version from `-SNAPSHOT` to the released version, commit and create the tags. It will then change the version to `-SNAPSHOT` for the next release.
12*a8de6003SAndroid Build Coastguard Worker1. Complete the release: `mvn release:perform`
13*a8de6003SAndroid Build Coastguard Worker1. [Log in to Nexus repository manager](https://oss.sonatype.org/index.html#welcome) at Sonatype and close the staging repository for Gson.
14*a8de6003SAndroid Build Coastguard Worker1. Download and sanity check all downloads. 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.
15*a8de6003SAndroid Build Coastguard Worker1. Release the staging repository for Gson. Gson will now get synced to Maven Central with-in the next hour. For issues consult [Sonatype Guide](https://central.sonatype.org/publish/release/).
16*a8de6003SAndroid Build Coastguard Worker1. Update [Gson Changelog](CHANGELOG.md). Also, look at all bugs that were fixed and add a few lines describing what changed in the release.
17*a8de6003SAndroid Build Coastguard Worker1. Update version references in (version might be referenced multiple times):
18*a8de6003SAndroid Build Coastguard Worker    - [`README.md`](README.md)
19*a8de6003SAndroid Build Coastguard Worker    - [`UserGuide.md`](UserGuide.md)
20*a8de6003SAndroid Build Coastguard Worker
21*a8de6003SAndroid Build Coastguard Worker    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.
22*a8de6003SAndroid Build Coastguard Worker1. Optional: Create a post on the [Gson Discussion Forum](https://groups.google.com/group/google-gson).
23*a8de6003SAndroid Build Coastguard Worker1. Optional: Update the release version in [Wikipedia](https://en.wikipedia.org/wiki/Gson) and update the current "stable" release.
24*a8de6003SAndroid Build Coastguard Worker
25*a8de6003SAndroid Build Coastguard WorkerImportant: 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).
26*a8de6003SAndroid Build Coastguard Worker
27*a8de6003SAndroid Build Coastguard Worker## Configuring a machine for deployment to Sonatype Repository
28*a8de6003SAndroid Build Coastguard Worker
29*a8de6003SAndroid Build Coastguard WorkerThis section was borrowed heavily from [Doclava release process](https://code.google.com/archive/p/doclava/wikis/ProcessRelease.wiki).
30*a8de6003SAndroid Build Coastguard Worker
31*a8de6003SAndroid Build Coastguard Worker1. Install/Configure GPG following this [guide](https://blog.sonatype.com/2010/01/how-to-generate-pgp-signatures-with-maven/).
32*a8de6003SAndroid Build Coastguard Worker1. [Create encrypted passwords](https://maven.apache.org/guides/mini/guide-encryption.html).
33*a8de6003SAndroid Build Coastguard Worker1. Create `~/.m2/settings.xml` similar to as described in [Doclava release process](https://code.google.com/p/doclava/wiki/ProcessRelease).
34*a8de6003SAndroid Build Coastguard Worker1. Now for deploying a snapshot repository, use `mvn deploy`.
35*a8de6003SAndroid Build Coastguard Worker
36*a8de6003SAndroid Build Coastguard Worker## Getting Maven Publishing Privileges
37*a8de6003SAndroid Build Coastguard Worker
38*a8de6003SAndroid Build Coastguard WorkerSee [OSSRH Publish Guide](https://central.sonatype.org/publish/publish-guide/).
39*a8de6003SAndroid Build Coastguard Worker
40*a8de6003SAndroid Build Coastguard Worker## Running Benchmarks or Tests on Android
41*a8de6003SAndroid Build Coastguard Worker
42*a8de6003SAndroid Build Coastguard Worker* Download vogar
43*a8de6003SAndroid Build Coastguard Worker* Put `adb` on your `$PATH` and run:
44*a8de6003SAndroid Build Coastguard Worker
45*a8de6003SAndroid Build Coastguard Worker  ```bash
46*a8de6003SAndroid Build Coastguard Worker  vogar --benchmark --classpath gson.jar path/to/Benchmark.java
47*a8de6003SAndroid Build Coastguard Worker  ```
48*a8de6003SAndroid Build Coastguard Worker
49*a8de6003SAndroid Build Coastguard WorkerFor example, here is how to run the [CollectionsDeserializationBenchmark](gson/src/main/java/com/google/gson/metrics/CollectionsDeserializationBenchmark.java):
50*a8de6003SAndroid Build Coastguard Worker
51*a8de6003SAndroid Build Coastguard Worker```bash
52*a8de6003SAndroid Build Coastguard Workerexport ANDROID_HOME=~/apps/android-sdk-mac_x86
53*a8de6003SAndroid Build Coastguard Workerexport PATH=$PATH:$ANDROID_HOME/platform-tools/:$ANDROID_HOME/android-sdk-mac_x86/tools/
54*a8de6003SAndroid Build Coastguard Worker$VOGAR_HOME/bin/vogar \
55*a8de6003SAndroid Build Coastguard Worker    --benchmark \
56*a8de6003SAndroid Build Coastguard Worker    --sourcepath ../gson/src/main/java/ \
57*a8de6003SAndroid Build Coastguard Worker    src/main/java/com/google/gson/metrics/CollectionsDeserializationBenchmark.java \
58*a8de6003SAndroid Build Coastguard Worker    -- \
59*a8de6003SAndroid Build Coastguard Worker    --vm "app_process -Xgc:noconcurrent,app_process"
60*a8de6003SAndroid Build Coastguard Worker```
61