Skip to content

Commit 8c229df

Browse files
committed
Merge branch 'bump-snapshot'
# Conflicts: # examples/example-custom-buckets/pom.xml # examples/example-exemplars-tail-sampling/example-greeting-service/pom.xml # examples/example-exemplars-tail-sampling/example-hello-world-app/pom.xml # examples/example-exporter-httpserver/pom.xml # examples/example-exporter-multi-target/pom.xml # examples/example-exporter-opentelemetry/pom.xml # examples/example-exporter-servlet-tomcat/pom.xml # examples/example-native-histogram/pom.xml # examples/example-otel-jvm-runtime-metrics/pom.xml # examples/example-prometheus-properties/pom.xml # examples/example-simpleclient-bridge/pom.xml
2 parents 05ad751 + 4b7cca3 commit 8c229df

File tree

50 files changed

+143
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+143
-84
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Release Please
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
release-please:
15+
if: ${{ github.repository == 'prometheus/client_java' }}
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}

.mise/tasks/build-release.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
#!/usr/bin/env bash
22

33
#MISE description="Build release package"
4-
#USAGE arg "<tag>" env="TAG" default="1.5.0-SNAPSHOT"
4+
#USAGE arg "[tag]" env="TAG"
55

66
set -euo pipefail
77

88
# shellcheck disable=SC2154 # is set by mise
9+
if [[ -z "${usage_tag:-}" ]]; then
10+
PARENT_POM="prometheus-metrics-parent/pom.xml"
11+
usage_tag=$(sed -n 's/.*<version>\(.*-SNAPSHOT\)<\/version>.*/\1/p' "$PARENT_POM" | head -1)
12+
if [[ -z "$usage_tag" ]]; then
13+
echo "ERROR: could not find SNAPSHOT version in $PARENT_POM" >&2
14+
exit 1
15+
fi
16+
fi
17+
918
VERSION=${usage_tag#v}
1019

1120
mise run set-version "$VERSION"

.mise/tasks/set-version.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

.release-please-config.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"packages": {
4+
".": {
5+
"release-type": "java",
6+
"versioning": "always-bump-patch",
7+
"extra-files": [
8+
"prometheus-metrics-parent/pom.xml",
9+
"integration-tests/it-spring-boot-smoke-test/pom.xml"
10+
]
11+
}
12+
}
13+
}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.5.0"
3+
}

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ or simply
5656
mise run compile
5757
```
5858

59+
## Version Numbers in Examples
60+
61+
Example `pom.xml` files (under `examples/`) should reference the latest
62+
**released** version, not a SNAPSHOT. After each release, Renovate
63+
updates these versions automatically.
64+
65+
Only use a SNAPSHOT version in an example when it demonstrates a new
66+
feature that has not been released yet.
67+
5968
## Updating the Protobuf Java Classes
6069

6170
The generated protobuf `Metrics.java` lives in a versioned package

RELEASING.md

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,58 @@
11
# Releasing Instructions for Prometheus Java Client
22

3-
## Before the Release
3+
Releases are automated via
4+
[release-please](https://github.com/googleapis/release-please).
45

5-
If there have been significant changes since the last release, update the
6-
benchmarks before creating a new release:
6+
## How It Works
77

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
1126

12-
## Create a Release
27+
Add a `release-as: X.Y.0` footer to any commit on `main`:
1328

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
1931
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
2139

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:
2542

26-
Replace `1.4.0-SNAPSHOT` with `1.5.0-SNAPSHOT` in all following files.
43+
```shell
44+
mise run update-benchmarks
45+
```
2746

28-
## If the GPG key expired
47+
## If the GPG Key Expired
2948

3049
1. Generate a new key:
3150
<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>

benchmarks/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<parent>
99
<groupId>io.prometheus</groupId>
1010
<artifactId>client_java</artifactId>
11-
<version>1.5.0-SNAPSHOT</version>
11+
<version>1.6.0-SNAPSHOT</version>
1212
</parent>
1313

1414
<artifactId>benchmarks</artifactId>

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.prometheus</groupId>
88
<artifactId>client_java</artifactId>
9-
<version>1.5.0-SNAPSHOT</version>
9+
<version>1.6.0-SNAPSHOT</version>
1010
</parent>
1111

1212
<artifactId>examples</artifactId>

integration-tests/it-common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.prometheus</groupId>
88
<artifactId>integration-tests</artifactId>
9-
<version>1.5.0-SNAPSHOT</version>
9+
<version>1.6.0-SNAPSHOT</version>
1010
</parent>
1111

1212
<artifactId>it-common</artifactId>

0 commit comments

Comments
 (0)