1Releasing 2========= 3 4### Prerequisite: Sonatype (Maven Central) Account 5 6Create an account on the [Sonatype issues site][sonatype_issues]. Ask an existing publisher to open 7an issue requesting publishing permissions for `com.squareup` projects. 8 9 10Cutting a Release 11----------------- 12 131. Update `CHANGELOG.md`. 14 152. Set versions: 16 17 ``` 18 export RELEASE_VERSION=X.Y.Z 19 export NEXT_VERSION=X.Y.Z-SNAPSHOT 20 ``` 21 223. Update versions: 23 24 ``` 25 sed -i "" \ 26 "s/VERSION_NAME=.*/VERSION_NAME=$RELEASE_VERSION/g" \ 27 gradle.properties 28 sed -i "" \ 29 "s/\"com.squareup.moshi:\([^\:]*\):[^\"]*\"/\"com.squareup.moshi:\1:$RELEASE_VERSION\"/g" \ 30 `find . -name "README.md"` 31 ``` 32 334. Tag the release and push to GitHub. 34 35 ``` 36 git commit -am "Prepare for release $RELEASE_VERSION." 37 git tag -a parent-$RELEASE_VERSION -m "Version $RELEASE_VERSION" 38 git push && git push --tags 39 ``` 40 415. Wait for [GitHub Actions][github_actions] to start building the release. 42 436. Prepare for ongoing development and push to GitHub. 44 45 ``` 46 sed -i "" \ 47 "s/VERSION_NAME=.*/VERSION_NAME=$NEXT_VERSION/g" \ 48 gradle.properties 49 git commit -am "Prepare next development version." 50 git push 51 ``` 52 537. Wait for [GitHub Actions][github_actions] to build and publish releases for both Windows and 54 Non-Windows. 55 568. Visit [Sonatype Nexus][sonatype_nexus] to promote (close then release) the releases. Or drop it 57 if there is a problem! 58 59 [github_actions]: https://github.com/square/moshi/actions 60 [sonatype_issues]: https://issues.sonatype.org/ 61 [sonatype_nexus]: https://oss.sonatype.org/ 62