Skip to content

Commit 2ba79e7

Browse files
authored
Merge pull request #1180 from square/ray/updated-release-recipe
Update RELEASING.md to encourage release branches.
2 parents c10f92d + c0c291b commit 2ba79e7

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

RELEASING.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
## Production Releases
44

55
---
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+
```
715

816
1. Confirm that the kotlin build is green before committing any changes
917
(Note we exclude benchmarks, but you can check those too!)
@@ -16,11 +24,6 @@
1624
developing - do not do this for actual releases) with the property `workflow.targets` which is
1725
set to any of `kmp`, `jvm`, `ios`, or `js`.
1826

19-
1. Update your tags.
20-
```bash
21-
git fetch --tags
22-
```
23-
2427
1. In `gradle.properties`, remove the `-SNAPSHOT` suffix from the `VERSION_NAME` property.
2528
E.g. `VERSION_NAME=0.1.0`
2629

@@ -30,12 +33,12 @@
3033
git tag v0.1.0
3134
```
3235

33-
1. Push those changes to the repository:
36+
1. Push the release branch and tag to the repository:
3437
```bash
35-
git push
38+
git push -u --tags
3639
```
3740

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.
3942

4043
1. Wait for that publishing job to succeed.
4144

@@ -44,15 +47,21 @@
4447
snapshot version, e.g. `VERSION_NAME=0.2.0-SNAPSHOT`.
4548

4649
1. Commit the new snapshot version:
47-
```
50+
```bash
4851
git commit -am "Finish releasing v0.1.0."
4952
```
5053

51-
1. Push your commits and tags:
54+
1. Push your release branch again:
55+
```bash
56+
git push origin release-v0.1
5257
```
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
5665
```
5766

5867
1. Create the release on GitHub:

0 commit comments

Comments
 (0)