Skip to content

Commit 49df461

Browse files
Merge pull request #7 from Aiven-Open/changelog-0.1.0
Changelog 0.1.0
2 parents 127291a + 44b60fb commit 49df461

5 files changed

Lines changed: 362 additions & 5 deletions

File tree

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#
2+
# Copyright 2026 Aiven Oy and project contributors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing,
11+
# software distributed under the License is distributed on an
12+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
13+
# KIND, either express or implied. See the License for the
14+
# specific language governing permissions and limitations
15+
# under the License.
16+
#
17+
# SPDX-License-Identifier: Apache-2.0
18+
19+
20+
name: Create release
21+
22+
on:
23+
workflow_dispatch:
24+
inputs:
25+
commit_hash:
26+
description: "Hash of 'Release version x.y.z' commit"
27+
required: true
28+
29+
permissions:
30+
contents: write
31+
pull-requests: write
32+
issues: write
33+
34+
jobs:
35+
build:
36+
name: Create Release
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v6
41+
with:
42+
ref: ${{ github.event.inputs.commit_hash }}
43+
44+
- name: Extract version info
45+
run: |
46+
export version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec);
47+
echo "version=${version}" >> $GITHUB_OUTPUT;
48+
echo "java_version=$(mvn -q -Dexec.executable=echo -Dexec.args='${jdk.version}' --non-recursive exec:exec)" >> $GITHUB_OUTPUT;
49+
export release_version=$(mvn -q -Dexec.executable=echo -Dexec.args='${latestRelease}' --non-recursive exec:exec);
50+
if [[ "${release_version}" == "${version}" ]]
51+
then
52+
echo "Creating draft release for ${release_version}"
53+
echo "release_version=${release_version}" >> $GITHUB_OUTPUT;
54+
else
55+
echo "Invalid 'latestRelease' in pom. ${release_version} != ${version}"
56+
exit 1
57+
fi
58+
export commit_title=$(git log --pretty=format:%s -1)
59+
echo "Commit title: $commit_title"
60+
if [[ ${commit_title} == "Release version ${release_version}" ]]; then
61+
echo "release_hash=$(git rev-list -n 1 v${release_version})" >> $GITHUB_OUTPUT
62+
else
63+
echo "Invalid commit title: "${commit_title}
64+
exit 1
65+
fi
66+
67+
if [[ `grep -c "^## " CHANGE_LOG.md` -gt 1 ]]
68+
then
69+
grep -B 999 -m2 "^## " CHANGE_LOG.md | head -n -1 > /tmp/release_body.txt
70+
else
71+
cp CHANGE_LOG.md /tmp/release_body.txt
72+
fi
73+
id: project
74+
75+
- name: Create tag
76+
run: |
77+
git config --local user.name "GitHub Action"
78+
git config --local user.email "action@github.com"
79+
git tag -a "v${{ steps.project.outputs.version }}" -m "Release version ${{ steps.project.outputs.version }}"
80+
git push origin "v${{ steps.project.outputs.version }}"
81+
82+
- name: Set up JDK ${{ steps.project.outputs.java_version }}
83+
uses: actions/setup-java@v5
84+
with:
85+
distribution: 'adopt'
86+
java-version: ${{ steps.project.outputs.java_version }}
87+
cache: 'maven'
88+
89+
- name: Setup Maven settings.xml
90+
uses: s4u/maven-settings-action@v4.0.0
91+
with:
92+
sonatypeSnapshots: false
93+
servers: |
94+
[{
95+
"id": "central",
96+
"username": "${{ secrets.SONATYPE_ID }}",
97+
"password": "${{ secrets.SONATYPE_PASSWORD }}"
98+
}]
99+
100+
- name: Publish ${{ steps.project.outputs.release_version }}
101+
run: mvn -P sign -P publish -e -B -V -ntp -Dgpg.signer=bc deploy
102+
env:
103+
MAVEN_GPG_KEY: ${{ secrets.GPG_KEY }}
104+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSWORD }}
105+
106+
- name: Create release draft
107+
id: create_release
108+
uses: softprops/action-gh-release@v2.6.0
109+
env:
110+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
with:
112+
tag_name: "v${{ steps.project.outputs.release_version }}"
113+
target_commitish: ${{ github.event.inputs.commit_hash }}
114+
draft: true
115+
prerelease: false
116+
files: target/*.jar
117+
body_path: /tmp/release_body.txt
118+
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#
2+
# Copyright 2026 Aiven Oy and project contributors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing,
11+
# software distributed under the License is distributed on an
12+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
13+
# KIND, either express or implied. See the License for the
14+
# specific language governing permissions and limitations
15+
# under the License.
16+
#
17+
# SPDX-License-Identifier: Apache-2.0
18+
19+
name: Create release PR
20+
on:
21+
workflow_dispatch:
22+
inputs:
23+
release_version:
24+
description: "Release version '0.1.2' (without 'v')"
25+
required: true
26+
snapshot_version:
27+
description: "Next SNAPSHOT version '0.2.0-SNAPSHOT' (without 'v')"
28+
required: true
29+
30+
permissions:
31+
contents: write
32+
pull-requests: write
33+
issues: write
34+
35+
jobs:
36+
create_release_pr:
37+
name: Create release PR (job)
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Check versions
41+
run: |
42+
echo "Checking release version..."
43+
if echo ${{ github.event.inputs.release_version }} | grep '^[0-9]+\.[0-9]+\.[0-9]+\(-\(alpha\|beta\|rc[0-9]\+\)\)\?\$' > /dev/null; then
44+
echo "Release version is invalid"
45+
exit 1
46+
fi
47+
48+
echo "Checking snapshot version..."
49+
if echo ${{ github.event.inputs.snapshot_version }} | grep '^[0-9]+\.[0-9]+\.[0-9]+-SNAPSHOT\$' > /dev/null; then
50+
echo "Snapshot version is invalid"
51+
exit 1
52+
fi
53+
54+
- name: Checkout main
55+
uses: actions/checkout@v6
56+
with:
57+
ref: main
58+
fetch-depth: 0
59+
60+
- name: Extract version info
61+
run: |
62+
echo "version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_OUTPUT;
63+
echo "java_version=$(mvn -q -Dexec.executable=echo -Dexec.args='${jdk.version}' --non-recursive exec:exec)" >> $GITHUB_OUTPUT;
64+
echo "# DO NOT SQUASH COMMITS" > /tmp/release_body.txt
65+
if [[ `grep -c "^## " CHANGE_LOG.md` -gt 1 ]]
66+
then
67+
grep -B 999 -m2 "^## " CHANGE_LOG.md | head -n -1 >> /tmp/release_body.txt
68+
else
69+
cat CHANGE_LOG.md >> /tmp/release_body.txt
70+
fi
71+
id: project
72+
73+
- name: Set up Java ${{ steps.project.outputs.java_version }}
74+
uses: actions/setup-java@v5
75+
with:
76+
distribution: 'adopt'
77+
java-version: ${{ steps.project.outputs.java_version }}
78+
cache: maven
79+
80+
- name: Create release commits
81+
run: |
82+
git config --local user.name "GitHub Action"
83+
git config --local user.email "action@github.com"
84+
mvn -e -B -V -ntp versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.release_version }} versions:set-property -Dproperty=latestRelease enforcer:enforce -Denforcer.rules=requireReleaseDeps
85+
git add pom.xml
86+
git commit -m "Release version ${{ github.event.inputs.release_version }}"
87+
git tag -a "v${{ steps.project.outputs.version }}" -m "Release version ${{ steps.project.outputs.version }}"
88+
89+
mvn -e -B -V -ntp versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.snapshot_version }}
90+
git add pom.xml
91+
git commit -m "Bump version to ${{ github.event.inputs.snapshot_version }}"
92+
93+
- name: Create Pull Request
94+
uses: peter-evans/create-pull-request@v8
95+
with:
96+
sign-commits: true
97+
branch: release-${{ github.event.inputs.release_version }}
98+
delete-branch: true
99+
draft: true
100+
title: Release version ${{ github.event.inputs.release_version }}
101+
body-path: /tmp/releaseg_body.txt
102+

CHANGE_LOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## v0.1.0
2+
### What is changed
3+
4+
- Add EnumValidator fixed UrlValidator (#27)
5+
- Add capability to hide config from documentation by using the internal config flag
6+
- By default filtering out internal configuration
7+
- Add setting ConfigDefBean with a property file (#38)
8+
9+
### Co-authored by
10+
11+
- Aindriu Lavelle
12+
- Claude Warren
13+
- Ryan Skraba
14+
15+
16+
### Full Changelog
17+
https://github.com/Aiven-Open/aiven-commons/compare/commons-1...v0.1.0

pom.xml

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>io.aiven.commons</groupId>
2424
<artifactId>aiven-commons</artifactId>
25-
<version>3-SNAPSHOT</version>
25+
<version>3</version>
2626
</parent>
2727

2828
<artifactId>kafka-config</artifactId>
@@ -87,7 +87,8 @@
8787
</distributionManagement>
8888

8989
<properties>
90-
<aiven.util.version>0.1.0-SNAPSHOT</aiven.util.version>
90+
<latestRelease>none</latestRelease>
91+
<aiven.util.version>0.1.0</aiven.util.version>
9192
</properties>
9293

9394
<dependencyManagement>
@@ -272,19 +273,70 @@
272273
</build>
273274
<profiles>
274275
<profile>
275-
<id>release</id>
276+
<id>publish</id>
276277
<build>
277278
<plugins>
278279
<plugin>
279280
<groupId>org.sonatype.central</groupId>
280281
<artifactId>central-publishing-maven-plugin</artifactId>
282+
<version>0.9.0</version>
281283
<extensions>true</extensions>
282284
<configuration>
283-
<publishingServerId>central-snapshot</publishingServerId>
285+
<publishingServerId>central</publishingServerId>
284286
<ignorePublishedComponents>true</ignorePublishedComponents>
285-
<centralSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots</centralSnapshotsUrl>
286287
</configuration>
287288
</plugin>
289+
<plugin>
290+
<groupId>org.apache.maven.plugins</groupId>
291+
<artifactId>maven-enforcer-plugin</artifactId>
292+
<version>3.6.2</version>
293+
<executions>
294+
<execution>
295+
<id>enforce-versions</id>
296+
<goals>
297+
<goal>enforce</goal>
298+
</goals>
299+
<configuration>
300+
<rules>
301+
<requireReleaseDeps>
302+
<message>No Snapshots Allowed!</message>
303+
</requireReleaseDeps>
304+
<requireReleaseVersion>
305+
<message>No Snapshots Allowed!</message>
306+
</requireReleaseVersion>
307+
</rules>
308+
</configuration>
309+
</execution>
310+
</executions>
311+
</plugin>
312+
</plugins>
313+
</build>
314+
</profile>
315+
<profile>
316+
<!-- used to verify that there are no SNAPSHOT dependencies -->
317+
<id>pre-release-check</id>
318+
<build>
319+
<plugins>
320+
<plugin>
321+
<groupId>org.apache.maven.plugins</groupId>
322+
<artifactId>maven-enforcer-plugin</artifactId>
323+
<version>3.6.2</version>
324+
<executions>
325+
<execution>
326+
<id>enforce-versions</id>
327+
<goals>
328+
<goal>enforce</goal>
329+
</goals>
330+
<configuration>
331+
<rules>
332+
<requireReleaseDeps>
333+
<message>No Snapshots Allowed!</message>
334+
</requireReleaseDeps>
335+
</rules>
336+
</configuration>
337+
</execution>
338+
</executions>
339+
</plugin>
288340
</plugins>
289341
</build>
290342
</profile>

0 commit comments

Comments
 (0)