|
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. |
| 19 | + |
| 20 | +## Patch Release (default) |
| 21 | + |
| 22 | +Simply merge the release PR — release-please bumps the patch version |
| 23 | +by default (e.g. `1.5.0` -> `1.5.1`). |
| 24 | + |
| 25 | +## Minor or Major Release |
11 | 26 |
|
12 | | -## Create a Release |
| 27 | +Add a `release-as: X.Y.0` footer to any commit on `main`: |
13 | 28 |
|
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". |
| 29 | +```text |
| 30 | +feat: add new feature |
19 | 31 |
|
20 | | -## Major or minor release |
| 32 | +release-as: 1.6.0 |
| 33 | +``` |
| 34 | + |
| 35 | +Alternatively, edit the release PR title to |
| 36 | +`chore(main): release 1.6.0`. |
| 37 | + |
| 38 | +## Before the Release |
21 | 39 |
|
22 | | -After the release is created, do a text replace everywhere in the repository to update the |
23 | | -snapshot version in the `pom.xml` files (and some other files) to the next version. |
24 | | -For example, if the last release was `1.4.0`, the next snapshot version should be `1.5.0-SNAPSHOT`. |
| 40 | +If there have been significant changes since the last release, update |
| 41 | +the benchmarks before merging the release PR: |
25 | 42 |
|
26 | | -Replace `1.4.0-SNAPSHOT` with `1.5.0-SNAPSHOT` in all following files. |
| 43 | +```shell |
| 44 | +mise run update-benchmarks |
| 45 | +``` |
27 | 46 |
|
28 | | -## If the GPG key expired |
| 47 | +## If the GPG Key Expired |
29 | 48 |
|
30 | 49 | 1. Generate a new key: |
31 | 50 | <https://central.sonatype.org/publish/requirements/gpg/#generating-a-key-pair> |
32 | | -2. Distribute the |
33 | | - key: <https://central.sonatype.org/publish/requirements/gpg/#distributing-your-public-key> |
34 | | -3. use `gpg --armor --export-secret-keys YOUR_ID` to |
35 | | - export ([docs](https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#gpg)) |
36 | | -4. Update the |
37 | | - passphrase: <https://github.com/prometheus/client_java/settings/secrets/actions/GPG_SIGNING_PASSPHRASE> <!-- editorconfig-checker-disable-line --> |
38 | | -5. Update the GPG |
39 | | - 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