Skip to content

ci: github action for automated releasing - #440

Draft
karel-rehor wants to merge 85 commits into
InfluxCommunity:mainfrom
karel-rehor:ci/gh-action-maven-releasing
Draft

ci: github action for automated releasing#440
karel-rehor wants to merge 85 commits into
InfluxCommunity:mainfrom
karel-rehor:ci/gh-action-maven-releasing

Conversation

@karel-rehor

Copy link
Copy Markdown
Contributor

Proposed Changes

Sets up automated releasing.

  1. For uploads to Maven Central replaces nexus-staging-maven-plugin with recommended central-publishing-maven-plugin
  2. Introduces a new Github Actions workflow maven-release.yml
    1. Verifies the action environment to ensure that all requred variables are present and valid.
    2. Executes the on-release.sh script which ensures values in pom.xml files and documentation match the release version and tag.
    3. Triggers the release process, which packages and then uploads the module to Maven Central.
    4. Automatically generates and then publishes Github pages. This will trigger a second Github Action "pages build and deployment".
    5. Autmatically updates CHANGELOG.md and pom.xml with the next release version. e.g. in pom.xml 1.11.0 is incremented to 1.12.0-SNAPSHOT.

Note this requires up-to-date values for action secrets

  • GPG_PASSPHRASE
  • GPG_PRIVATE_KEY (in tests using key for karel-rehor@users.noreply.github.com which is password protected and without expiration, so it could be used in production.)
  • SONATYPE_PASSWORD
  • SONATYPE_USERNAME
Screenshot from 2026-09-10 16-23-37

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • [ ] A test has been added if appropriate N.A.
  • Tests pass
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@karel-rehor
karel-rehor requested a review from bednar September 10, 2026 14:32
@karel-rehor
karel-rehor marked this pull request as draft September 10, 2026 14:34

@bednar bednar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR. There are a few requirements which has to be satisfied:

</servers>
</settings>
EOF
git config --global user.email "test@example.com"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to something more real.

Comment thread examples/pom.xml
<groupId>com.influxdb</groupId>
<artifactId>influxdb3-java</artifactId>
<version>1.12.0-SNAPSHOT</version>
<version>1.12.0</version>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in main?

Comment thread pom.xml
<artifactId>influxdb3-java</artifactId>
<packaging>jar</packaging>
<version>1.12.0-SNAPSHOT</version>
<version>1.12.0</version>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in main?

Comment thread pom.xml
<developerConnection>scm:git:https://github.com/InfluxCommunity/influxdb3-java.git</developerConnection>
<url>https://github.com/InfluxCommunity/influxdb3-java/tree/main</url>
<tag>HEAD</tag>
<tag>v1.12.0</tag>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in main?

Comment thread README.md
<groupId>com.influxdb</groupId>
<artifactId>influxdb3-java</artifactId>
<version>1.11.0</version>
<version>1.12.0</version>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in main?

Comment thread RELEASE.md Outdated
```
$ gpg2 --keyserver keyserver.ubuntu.com --search-keys REDACTED_KEY_ID
gpg: data source: http://185.125.188.27:11371
(1) karel-rehor@users.noreply.github.com

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(1) karel-rehor@users.noreply.github.com
(1) your-user@users.noreply.github.com

Comment thread RELEASE.md Outdated
(1) karel-rehor@users.noreply.github.com
263 bit EDDSA key REDACTED, created: 2026-09-03
Keys 1-1 of 1 for "REDACTED_KEY_ID". Enter number(s), N)ext, or Q)uit > 1
gpg: key REDACTED: "karel-rehor@users.noreply.github.com" not changed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
gpg: key REDACTED: "karel-rehor@users.noreply.github.com" not changed
gpg: key REDACTED: "your-user@users.noreply.github.com" not changed

Comment thread RELEASE.md Outdated
-----------------------------
pub ed25519 2026-07-27 [SC] [expires: 2029-07-26]
KEY_ID_REDACTED
uid [ultimate] karel-rehor@users.noreply.github.com

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uid [ultimate] karel-rehor@users.noreply.github.com
uid [ultimate] your-user@users.noreply.github.com

Comment thread RELEASE.md Outdated
$ gpg2 --list-keys KEY_ID_REDACTED
pub ed25519 2026-07-27 [SC] [expires: 2029-07-26]
KEY_ID_REDACTED
uid [ultimate] karel-rehor@users.noreply.github.com

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uid [ultimate] karel-rehor@users.noreply.github.com
uid [ultimate] your-user@users.noreply.github.com

Comment thread RELEASE.md Outdated
(1) karel-rehor@users.noreply.github.com
263 bit EDDSA key REDACTED, created: 2026-07-27
Keys 1-1 of 1 for "KEY_ID_REDACTED". Enter number(s), N)ext, or Q)uit > 1
gpg: key REDACTED: "karel-rehor@users.noreply.github.com" not changed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
gpg: key REDACTED: "karel-rehor@users.noreply.github.com" not changed
gpg: key REDACTED: "your-user@users.noreply.github.com" not changed

@bednar bednar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the selected inline comments before merge.

mvn versions:set -DnextSnapshot=true -DnextSnapshotIndexToIncrement=2
sed -i "1s/^/## ${NEXT_RELEASE:1} [unreleased]\n\n/" CHANGELOG.md
sed -i -e "s/<version>${RELEASE_TAG_NAME:1}<\/version>/<version>${NEXT_RELEASE:1}-SNAPSHOT<\/version>/" examples/pom.xml
git add pom.xml CHANGELOG.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also stage examples/pom.xml here. The previous command rewrites its dependency from the released version to ${NEXT_RELEASE:1}-SNAPSHOT, but this git add omits the file, so the pushed next-cycle branch retains the released dependency version and the preparation is incomplete.

Comment thread scripts/on-release.sh
RC_OR_BETA=false
IS_SNAPSHOT=false

FAILURE_BOILERPLATE="Please delete the tag ${CIRCLE_TAG} and the related release, and start again."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace ${CIRCLE_TAG} with the GitHub Actions release tag, such as ${RELEASE_TAG_NAME}. This script runs in GitHub Actions, so ${CIRCLE_TAG} is unset; every failure message currently says to delete an empty tag, which makes the recovery instructions unusable.

Comment thread scripts/on-release.sh
EXAMPLE_POM_XML_PATH="${PROJECT_DIR}/examples/pom.xml"

RELEASE_NUM=""
NEXT_RELEASE_NUM=""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The declarations NEXT_RELEASE_NUM, NEXT_RELEASE_BRANCH_BASE, RC_OR_BETA, and IS_SNAPSHOT are never read. Please remove them or wire them into the implementation; they are dead code and trigger ShellCheck warnings.

Comment thread scripts/on-release.sh
if [ "${SCM_TAG}" != "${RELEASE_TAG_NAME}" ]
then
printf "SCM_TAG %s in pom.xml does not match tag %s" "${SCM_TAG}" "${RELEASE_TAG_NAME}"
prinf "%s\n" "${FAILURE_BOILERPLATE}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prinf is a typo for printf. With set -e, this branch exits on the command-not-found error before printing the intended recovery message. Please fix the typo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants