|
3 | 3 | ## Production Releases
|
4 | 4 |
|
5 | 5 | ---
|
6 |
| -1. Make sure you're on the `main` branch (or fix branch, e.g. `v0.1-fixes`). |
| 6 | +1. Pull a fresh copy of `origin/main` and tags. |
| 7 | + ```bash |
| 8 | + git fetch --tags |
| 9 | + ``` |
| 10 | + |
| 11 | +1. Create a release branch off of `origin/main` (e.g. `release-v0.1`). (If this is a patch release, re-use the existing release branch if it still exists, or else check out a new one from the appropriate tag.) |
| 12 | + ```bash |
| 13 | + git co -b release-v0.1 origin/main |
| 14 | + ``` |
7 | 15 |
|
8 | 16 | 1. Confirm that the kotlin build is green before committing any changes
|
9 | 17 | (Note we exclude benchmarks, but you can check those too!)
|
|
16 | 24 | developing - do not do this for actual releases) with the property `workflow.targets` which is
|
17 | 25 | set to any of `kmp`, `jvm`, `ios`, or `js`.
|
18 | 26 |
|
19 |
| -1. Update your tags. |
20 |
| - ```bash |
21 |
| - git fetch --tags |
22 |
| - ``` |
23 |
| - |
24 | 27 | 1. In `gradle.properties`, remove the `-SNAPSHOT` suffix from the `VERSION_NAME` property.
|
25 | 28 | E.g. `VERSION_NAME=0.1.0`
|
26 | 29 |
|
|
30 | 33 | git tag v0.1.0
|
31 | 34 | ```
|
32 | 35 |
|
33 |
| -1. Push those changes to the repository: |
| 36 | +1. Push the release branch and tag to the repository: |
34 | 37 | ```bash
|
35 |
| - git push |
| 38 | + git push -u --tags |
36 | 39 | ```
|
37 | 40 |
|
38 |
| -1. Run the `Publish Release` action in the [GitHub Actions](https://github.com/square/workflow-kotlin/actions/workflows/publish-release.yml) page by clicking "run workflow" on the right. |
| 41 | +1. Run the `Publish Release` action in the [GitHub Actions](https://github.com/square/workflow-kotlin/actions/workflows/publish-release.yml) page by clicking "run workflow" on the right. Select the appropriate tag. |
39 | 42 |
|
40 | 43 | 1. Wait for that publishing job to succeed.
|
41 | 44 |
|
|
44 | 47 | snapshot version, e.g. `VERSION_NAME=0.2.0-SNAPSHOT`.
|
45 | 48 |
|
46 | 49 | 1. Commit the new snapshot version:
|
47 |
| - ``` |
| 50 | + ```bash |
48 | 51 | git commit -am "Finish releasing v0.1.0."
|
49 | 52 | ```
|
50 | 53 |
|
51 |
| -1. Push your commits and tags: |
| 54 | +1. Push your release branch again: |
| 55 | + ```bash |
| 56 | + git push origin release-v0.1 |
52 | 57 | ```
|
53 |
| - git push origin main && git push --tags |
54 |
| - # or git push origin fix-branch |
55 |
| - git push origin v0.1.0 && git push --tags |
| 58 | + |
| 59 | +1. Merge the release branch into main and push again: |
| 60 | + ```bash |
| 61 | + git co main |
| 62 | + git reset --hard origin/main |
| 63 | + git merge --no-ff release-v0.1 |
| 64 | + git push origin main |
56 | 65 | ```
|
57 | 66 |
|
58 | 67 | 1. Create the release on GitHub:
|
|
0 commit comments