Skip to content

Commit 8963973

Browse files
authored
Release automation (#1154)
* release automation Signed-off-by: Gregor Zeitlinger <[email protected]> * release automation Signed-off-by: Gregor Zeitlinger <[email protected]> * release Signed-off-by: Gregor Zeitlinger <[email protected]> * release Signed-off-by: Gregor Zeitlinger <[email protected]> * release Signed-off-by: Gregor Zeitlinger <[email protected]> * release Signed-off-by: Gregor Zeitlinger <[email protected]> * release Signed-off-by: Gregor Zeitlinger <[email protected]> * release Signed-off-by: Gregor Zeitlinger <[email protected]> * release Signed-off-by: Gregor Zeitlinger <[email protected]> * secrets are not available for prs Signed-off-by: Gregor Zeitlinger <[email protected]> * secrets are not available for prs Signed-off-by: Gregor Zeitlinger <[email protected]> * secrets are not available for prs Signed-off-by: Gregor Zeitlinger <[email protected]> --------- Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent c06da1a commit 8963973

File tree

48 files changed

+179
-195
lines changed

Some content is hidden

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

48 files changed

+179
-195
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
REQUIRE_PROTO_UP_TO_DATE: true
2929
run: |
3030
./mvnw clean install
31-
./mvnw javadoc:javadoc
31+
./mvnw javadoc:javadoc -P release # just to check if javadoc is generated

.github/workflows/github-pages.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,10 @@ jobs:
4444
run: |
4545
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
4646
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
47-
#- name: Install Dart Sass
48-
# run: sudo snap install dart-sass
49-
- name: Checkout
50-
uses: actions/checkout@v4
51-
with:
52-
submodules: recursive
53-
fetch-depth: 0
5447
- name: Build client_java
55-
run: ./mvnw -B clean install -DskipTests
48+
run: ./mvnw -B clean install -DskipTests -P release
5649
- name: Make Javadoc
57-
run: ./mvnw -B clean compile javadoc:javadoc javadoc:aggregate
50+
run: ./mvnw -B clean compile javadoc:javadoc javadoc:aggregate -P release
5851
- name: Move the Javadoc to docs/static/api/
5952
run: mv ./target/reports/apidocs ./docs/static/api && echo && echo 'ls ./docs/static/api' && ls ./docs/static/api
6053
- name: Setup Pages

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy to Maven Central
2+
3+
#on:
4+
# push:
5+
# tags:
6+
# - v*
7+
on:
8+
push:
9+
branches: [ "main" ]
10+
# pull_request:
11+
# branches: [ "main" ]
12+
13+
jobs:
14+
deploy:
15+
if: ${{ github.repository == 'prometheus/client_java' }}
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout Plugin Repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set Up JDK
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: 17
26+
distribution: temurin
27+
cache: 'maven'
28+
29+
- name: Build with Maven
30+
run: mvn -B package -P release -Dmaven.test.skip=true
31+
32+
- name: Set up Apache Maven Central
33+
uses: actions/setup-java@v4
34+
with:
35+
distribution: 'temurin'
36+
java-version: '17'
37+
server-id: ossrh
38+
server-username: MAVEN_USERNAME
39+
server-password: MAVEN_CENTRAL_TOKEN
40+
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
41+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
42+
43+
- name: Publish to Apache Maven Central
44+
run: mvn deploy -P release
45+
env:
46+
MAVEN_USERNAME: ${{ secrets.SONATYPE_MAVEN_REPOSITORY_USERNAME }}
47+
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_REPOSITORY_PASSWORD }}
48+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }}

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ Run `./mvnw spotless:apply` to format the code (only changed files) before commi
2222
If you're getting errors when running tests:
2323

2424
- Make sure that the IDE uses only the "Maven Shade" dependency of "prometheus-metrics-exposition-formats" and the "prometheus-metrics-tracer*" dependencies.
25+
26+
## Updating the Protobuf Java Classes
27+
28+
Use `PROTO_GENERATION=true mvn clean install` to generate protobuf classes.

MAINTAINER_NOTES.md

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

RELEASING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Update Version
2+
3+
In a new PR, update the version in `pom.xml` using
4+
5+
```shell
6+
mvn versions:set -DnewVersion=<VERSION>
7+
```
8+
9+
Commit the changes and open a PR.
10+
11+
## Publish Release via Github Workflow
12+
13+
On main branch, create a tag for the new version to trigger the release workflow.
14+
15+
```sh
16+
git tag -a v<VERSION> -m "Release v<VERSION>"
17+
git push origin v<VERSION>
18+
```
19+
20+
## Create a Release
21+
22+
1. Go to https://github.com/prometheus/client_java/releases
23+
2. Click on "Choose a tag", enter the tag name (e.g. `v0.1.0`), and click "Create a new tag".
24+
3. Click on "Generate release notes" to auto-generate the release notes based on the commits since the last release.
25+
4. Click on "Publish release".

benchmarks/pom.xml

Lines changed: 1 addition & 2 deletions
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.4.0-SNAPSHOT</version>
9+
<version>0.0.1-releasetest1</version>
1010
</parent>
1111

1212
<artifactId>benchmarks</artifactId>
@@ -20,7 +20,6 @@
2020
<jmh.version>1.37</jmh.version>
2121
<simpleclient.version>0.16.0</simpleclient.version>
2222
<codahale.version>3.0.2</codahale.version>
23-
<maven.javadoc.skip>true</maven.javadoc.skip>
2423
</properties>
2524

2625
<dependencies>

examples/example-exemplars-tail-sampling/example-greeting-service/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.prometheus</groupId>
77
<artifactId>example-exemplars-tail-sampling</artifactId>
8-
<version>1.4.0-SNAPSHOT</version>
8+
<version>0.0.1-releasetest1</version>
99
</parent>
1010

1111
<artifactId>example-greeting-service</artifactId>

examples/example-exemplars-tail-sampling/example-hello-world-app/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.prometheus</groupId>
77
<artifactId>example-exemplars-tail-sampling</artifactId>
8-
<version>1.4.0-SNAPSHOT</version>
8+
<version>0.0.1-releasetest1</version>
99
</parent>
1010

1111
<artifactId>example-hello-world-app</artifactId>

examples/example-exemplars-tail-sampling/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.prometheus</groupId>
77
<artifactId>examples</artifactId>
8-
<version>1.4.0-SNAPSHOT</version>
8+
<version>0.0.1-releasetest1</version>
99
</parent>
1010

1111
<artifactId>example-exemplars-tail-sampling</artifactId>

0 commit comments

Comments
 (0)