|
| 1 | +Releasing |
| 2 | +========= |
| 3 | + |
| 4 | +Production Releases |
| 5 | +------------------- |
| 6 | + |
| 7 | +1. Merge an update of [the change log](CHANGELOG.md) with the changes since the last release. |
| 8 | + |
| 9 | +1. Make sure you're on the `master` branch (or fix branch, e.g. `v0.1-fixes`). |
| 10 | + |
| 11 | +1. Confirm that the kotlin build is green before committing any changes |
| 12 | + ```bash |
| 13 | + (cd kotlin && ./gradlew build connectedCheck) |
| 14 | + ``` |
| 15 | + |
| 16 | +1. In `kotlin/gradle.properties`, remove the `-SNAPSHOT` prefix from the `VERSION_NAME` property. |
| 17 | + E.g. `VERSION_NAME=0.1.0` |
| 18 | + |
| 19 | +1. Create a commit and tag the commit with the version number: |
| 20 | + ```bash |
| 21 | + git commit -am "Releasing v0.1.0." |
| 22 | + git tag v0.1.0 |
| 23 | + ``` |
| 24 | + |
| 25 | +1. Upload the kotlin artifacts: |
| 26 | + ```bash |
| 27 | + (cd kotlin && ./gradlew build && ./gradlew uploadArchives --no-parallel) |
| 28 | + ``` |
| 29 | + |
| 30 | +1. Close and release the staging repository at https://oss.sonatype.org. |
| 31 | + |
| 32 | +1. Update the `VERSION_NAME` property in `kotlin/gradle.properties` to the new |
| 33 | + snapshot version, e.g. `VERSION_NAME=0.2.0-SNAPSHOT`. |
| 34 | + |
| 35 | +1. Commit the new snapshot version: |
| 36 | + ``` |
| 37 | + git commit -am "Finish releasing v0.1.0." |
| 38 | + ``` |
| 39 | + |
| 40 | +1. Push your commits and tag: |
| 41 | + ``` |
| 42 | + git push origin master |
| 43 | + # or git push origin fix-branch |
| 44 | + git push origin v0.1.0 |
| 45 | + ``` |
| 46 | + |
| 47 | +1. Create the release on GitHub: |
| 48 | + 1. Go to the [Releases](https://github.com/square/workflow-kotlin-compose/releases) page for the GitHub |
| 49 | + project. |
| 50 | + 1. Click "Draft a new release". |
| 51 | + 1. Enter the tag name you just pushed. |
| 52 | + 1. Title the release with the same name as the tag. |
| 53 | + 1. Copy & paste the changelog entry for this release into the description. |
| 54 | + 1. If this is a pre-release version, check the pre-release box. |
| 55 | + 1. Hit "Publish release". |
| 56 | + |
| 57 | +1. If this was a fix release, merge changes to the master branch: |
| 58 | + ```bash |
| 59 | + git checkout master |
| 60 | + git pull |
| 61 | + git merge --no-ff v0.1-fixes |
| 62 | + # Resolve conflicts. Accept master's versions of gradle.properties and podspecs. |
| 63 | + git push origin master |
| 64 | + ``` |
| 65 | + |
| 66 | +1. Publish the website. See below. |
| 67 | + |
| 68 | +--- |
| 69 | + |
| 70 | +## Kotlin Notes |
| 71 | + |
| 72 | +### Development |
| 73 | + |
| 74 | +To build and install the current version to your local Maven repository (`~/.m2`), run: |
| 75 | + |
| 76 | +```bash |
| 77 | +./gradlew clean installArchives |
| 78 | +``` |
| 79 | + |
| 80 | +### Deploying |
| 81 | + |
| 82 | +#### Configuration |
| 83 | + |
| 84 | +In order to deploy artifacts to a Maven repository, you'll need to set 4 properties in your private |
| 85 | +Gradle properties file (`~/.gradle/gradle.properties`): |
| 86 | + |
| 87 | +``` |
| 88 | +RELEASE_REPOSITORY_URL=<url of release repository> |
| 89 | +SNAPSHOT_REPOSITORY_URL=<url of snapshot repository |
| 90 | +SONATYPE_NEXUS_USERNAME=<username> |
| 91 | +SONATYPE_NEXUS_PASSWORD=<password> |
| 92 | +``` |
| 93 | + |
| 94 | +#### Snapshot Releases |
| 95 | + |
| 96 | +Double-check that `gradle.properties` correctly contains the `-SNAPSHOT` suffix, then upload |
| 97 | +snapshot artifacts to Sonatype just like you would for a production release: |
| 98 | + |
| 99 | +```bash |
| 100 | +./gradlew clean build && ./gradlew uploadArchives --no-parallel |
| 101 | +``` |
| 102 | + |
| 103 | +You can verify the artifacts are available by visiting |
| 104 | +https://oss.sonatype.org/content/repositories/snapshots/com/squareup/workflow/. |
0 commit comments