|
1 | 1 | # Releasing Instructions for Prometheus Java Client |
2 | 2 |
|
3 | | -## Before the Release |
| 3 | +Releases are automated via |
| 4 | +[release-please](https://github.com/googleapis/release-please). |
4 | 5 |
|
5 | | -If there have been significant changes since the last release, update the |
6 | | -benchmarks before creating a new release: |
| 6 | +## How It Works |
7 | 7 |
|
8 | | -```shell |
9 | | -mise run update-benchmarks |
10 | | -``` |
| 8 | +1. Commits to `main` using |
| 9 | + [Conventional Commits](https://www.conventionalcommits.org/) are |
| 10 | + tracked by release-please. |
| 11 | +2. Release-please maintains a release PR that accumulates changes and |
| 12 | + updates the changelog. |
| 13 | +3. When the release PR is merged, release-please creates a GitHub |
| 14 | + release and a `vX.Y.Z` tag. |
| 15 | +4. The tag triggers the existing `release.yml` workflow, which deploys |
| 16 | + to Maven Central. |
| 17 | +5. After tagging, release-please opens a follow-up PR to bump the |
| 18 | + SNAPSHOT version in all `pom.xml` files. |
11 | 19 |
|
12 | | -## Create a Release |
| 20 | +## Patch Release (default) |
13 | 21 |
|
14 | | -1. Go to <https://github.com/prometheus/client_java/releases/new> |
15 | | -2. Click on "Choose a tag", enter the tag name (e.g. `v0.1.0`), and click "Create a new tag". |
16 | | -3. Click on "Generate release notes" to auto-generate the release notes based on the commits since |
17 | | - the last release. |
18 | | -4. Click on "Publish release". |
| 22 | +Simply merge the release PR — release-please bumps the patch version |
| 23 | +by default (e.g. `1.5.0` -> `1.5.1`). |
19 | 24 |
|
20 | | -## Major or minor release |
| 25 | +## Minor or Major Release |
21 | 26 |
|
22 | | -After the release is created, bump the snapshot version in all |
23 | | -`pom.xml` files: |
| 27 | +Add a `release-as: X.Y.0` footer to any commit on `main`: |
24 | 28 |
|
25 | | -```shell |
26 | | -# Auto-increment the minor version (e.g. 1.5.0-SNAPSHOT -> 1.6.0-SNAPSHOT) |
27 | | -mise run bump-snapshot |
| 29 | +```text |
| 30 | +feat: add new feature |
| 31 | +
|
| 32 | +release-as: 1.6.0 |
| 33 | +``` |
28 | 34 |
|
29 | | -# Or specify an explicit version (e.g. for a major bump) |
30 | | -mise run bump-snapshot 2.0.0-SNAPSHOT |
| 35 | +Alternatively, edit the release PR title to |
| 36 | +`chore(main): release 1.6.0`. |
| 37 | + |
| 38 | +## Before the Release |
| 39 | + |
| 40 | +If there have been significant changes since the last release, update |
| 41 | +the benchmarks before merging the release PR: |
| 42 | + |
| 43 | +```shell |
| 44 | +mise run update-benchmarks |
31 | 45 | ``` |
32 | 46 |
|
33 | | -## If the GPG key expired |
| 47 | +## If the GPG Key Expired |
34 | 48 |
|
35 | 49 | 1. Generate a new key: |
36 | 50 | <https://central.sonatype.org/publish/requirements/gpg/#generating-a-key-pair> |
37 | | -2. Distribute the |
38 | | - key: <https://central.sonatype.org/publish/requirements/gpg/#distributing-your-public-key> |
39 | | -3. use `gpg --armor --export-secret-keys YOUR_ID` to |
40 | | - export ([docs](https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#gpg)) |
41 | | -4. Update the |
42 | | - passphrase: <https://github.com/prometheus/client_java/settings/secrets/actions/GPG_SIGNING_PASSPHRASE> <!-- editorconfig-checker-disable-line --> |
43 | | -5. Update the GPG |
44 | | - key: <https://github.com/prometheus/client_java/settings/secrets/actions/GPG_SIGNING_KEY> |
| 51 | +2. Distribute the key: |
| 52 | + <https://central.sonatype.org/publish/requirements/gpg/#distributing-your-public-key> |
| 53 | +3. Use `gpg --armor --export-secret-keys YOUR_ID` to export |
| 54 | + ([docs](https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#gpg)) |
| 55 | +4. Update the passphrase: |
| 56 | + <https://github.com/prometheus/client_java/settings/secrets/actions/GPG_SIGNING_PASSPHRASE> |
| 57 | +5. Update the GPG key: |
| 58 | + <https://github.com/prometheus/client_java/settings/secrets/actions/GPG_SIGNING_KEY> |
0 commit comments