xref: /aosp_15_r20/external/accompanist/docs/updating.md (revision fa44fe6ae8e729aa3cfe5c03eedbbf98fb44e2c6)
1# Updating & releasing Accompanist
2
3This doc is mostly for maintainers.
4
5## New features & bugfixes
6All new features should be uploaded as PRs against the `main` branch.
7
8Once merged into `main`, they will be automatically merged into the `snapshot` branch.
9
10## Jetpack Compose Snapshots
11
12We publish snapshot versions of Accompanist, which depend on a `SNAPSHOT` versions of Jetpack Compose. These are built from the `snapshot` branch.
13
14### Updating to a newer Compose snapshot
15
16As mentioned above, updating to a new Compose snapshot is done by submitting a new PR against the `snapshot` branch:
17
18``` sh
19git checkout snapshot && git pull
20# Create branch for PR
21git checkout -b update_snapshot
22```
23
24Now edit the project to depend on the new Compose SNAPSHOT version:
25
26Edit [`/gradle/libs.versions.toml`](https://github.com/google/accompanist/blob/main/gradle/libs.versions.toml):
27
28Under `[versions]`:
29
301. Update the `composesnapshot` property to be the snapshot number
312. Ensure that the `compose` property is correct
32
33Make sure the project builds and test pass:
34```
35./gradlew check
36```
37
38Now `git commit` the changes and push to GitHub.
39
40Finally create a PR (with the base branch as `snapshot`) and send for review.
41
42## Releasing
43
44Once the next Jetpack Compose version is out, we're ready to push a new release:
45
46### #1: Merge `snapshot` into `main`
47
48First we merge the `snapshot` branch into `main`:
49
50``` sh
51git checkout snapshot && git pull
52git checkout main && git pull
53
54# Create branch for PR
55git checkout -b main_snapshot_merge
56
57# Merge in the snapshot branch
58git merge snapshot
59```
60
61### #2: Update dependencies
62
63Edit [`/gradle/libs.versions.toml`](https://github.com/google/accompanist/blob/main/gradle/libs.versions.toml):
64
65Under `[versions]`:
66
671. Update the `composesnapshot` property to a single character (usually `-`). This disables the snapshot repository.
682. Update the `compose` property to match the new release (i.e. `1.0.0-beta06`)
69
70Make sure the project builds and test pass:
71```
72./gradlew check
73```
74
75Commit the changes.
76
77### #3: Bump the version number
78
79Edit [gradle.properties](https://github.com/google/accompanist/blob/main/gradle.properties):
80
81 * Update the `VERSION_NAME` property and remove the `-SNAPSHOT` suffix.
82
83Commit the changes, using the commit message containing the new version name.
84
85### #4: Push to GitHub
86
87Push the branch to GitHub and create a PR against the `main` branch, and send for review. Once approved and merged, it will be automatically deployed to Maven Central.
88
89### #5: Create release
90
91Once the above PR has been approved and merged, we need to create the GitHub release:
92
93 * Open up the [Releases](https://github.com/google/accompanist/releases) page.
94 * At the top you should see a 'Draft' release, auto populated with any PRs since the last release. Click 'Edit'.
95 * Make sure that the version number matches what we released (the tool guesses but is not always correct).
96 * Double check everything, then press 'Publish release'.
97
98At this point the release is published. This will trigger the docs action to run, which will auto-deploy a new version of the [website](https://google.github.io/accompanist/).
99
100### #6: Prepare the next development version
101
102The current release is now finished, but we need to update the version for the next development version:
103
104Edit [gradle.properties](https://github.com/google/accompanist/blob/main/gradle.properties):
105
106 * Update the `VERSION_NAME` property, by increasing the version number, and adding the `-SNAPSHOT` suffix.
107 * Example: released version: `0.3.0`. Update to `0.3.1-SNAPSHOT`
108
109 `git commit` and push to `main`.
110
111Finally, merge all of these changes back to `snapshot`:
112
113```
114git checkout snapshot && git pull
115git merge main
116git push
117```