Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
63527a3
ci: start maven-release.yml workflow
karel-rehor Sep 2, 2026
a7fb454
chore: remove branches tag on release trigger
karel-rehor Sep 2, 2026
07c0179
chore: add here doc for generating release.properties
karel-rehor Sep 2, 2026
fc9e61f
chore: fix typo
karel-rehor Sep 2, 2026
f9e2f7b
chore: update pom.xml and deploy-settings.xml for fork.
karel-rehor Sep 2, 2026
e4924eb
chore: add simple volume check to workflow
karel-rehor Sep 2, 2026
e3c8b73
chore: add release command to model release step
karel-rehor Sep 2, 2026
ca363ca
chore: reintroduce verify step to maven0release.yml workflow
karel-rehor Sep 3, 2026
ef9469d
docs: start RELEASE.md
karel-rehor Sep 3, 2026
1bb3896
docs: document gpg2 key generation in RELEASE.md.
karel-rehor Sep 3, 2026
f9695e4
chore: reintroduce checks in scripts/on-release.sh
karel-rehor Sep 3, 2026
46bf3d1
docs: update temporary notes in CHANGELOG.md
karel-rehor Sep 3, 2026
e26af07
chore: fix file permissions for on-release.sh
karel-rehor Sep 4, 2026
bdcffe0
docs: temporary change to release date - for testing workflow.
karel-rehor Sep 4, 2026
e0a9412
docs: temporary update toe README.md to test workflow.
karel-rehor Sep 4, 2026
4e52241
chore: set correct scm version an update RELEASE.md
karel-rehor Sep 4, 2026
8dff66d
chore: add scm/tag value check to on-release.sh
karel-rehor Sep 4, 2026
1eee676
chore: fix dropped variable in on-release.sh
karel-rehor Sep 4, 2026
dabbd1f
chore: temporarily change scm tag to test workflow failure.
karel-rehor Sep 4, 2026
93a7e9d
chore: revert scm tag in pom.xml after workflow test proven correct.
karel-rehor Sep 4, 2026
fdce5bc
chore: start workflow step Prepare next cycle.
karel-rehor Sep 4, 2026
d07c44f
chore: get correct TAG_NAME envar in workflow script.
karel-rehor Sep 7, 2026
8b9409a
chore: set next release cycle branch
karel-rehor Sep 7, 2026
933d9d5
chore: fix broken variable string in script.
karel-rehor Sep 7, 2026
602d2cb
chore: temporarily add debugging checks to workflow script.
karel-rehor Sep 7, 2026
c8b67a6
chore: add automatic update to CHANGELOG.md in workflow.
karel-rehor Sep 7, 2026
29aff53
chore: use correct envar in workflow script.
karel-rehor Sep 7, 2026
d4dc622
chore: fix formatting of next release CHANGELOG.md header
karel-rehor Sep 7, 2026
8098ee9
chore: setup automated git commands for next release cycle.
karel-rehor Sep 7, 2026
6c17568
chore: setup github identity in release workflow prepare next cycle.
karel-rehor Sep 7, 2026
4f69b60
chore: fix push to origin in workstream Prepare next cycle.
karel-rehor Sep 7, 2026
29d4bae
chore: fix origin repository in workflow Prepare next release cycle.
karel-rehor Sep 7, 2026
6410172
chore: setup automatic PR for new release cycle.
karel-rehor Sep 7, 2026
ff9cb5a
chore: update permissions to allow creation of PR.
karel-rehor Sep 7, 2026
b0dbac5
chore: remove automatic PR merge command - requires permission change…
karel-rehor Sep 7, 2026
ee489d0
chore: add site documentation update step. Update RELEASE.md
karel-rehor Sep 7, 2026
9bc7007
chore: add checks and updates to examples/pom.xml
karel-rehor Sep 7, 2026
1c8ae70
chore: temporarily change examples dependency version to verify workf…
karel-rehor Sep 7, 2026
d7f69a0
chore: fix typo
karel-rehor Sep 7, 2026
796fccd
chore: tidy maven-release.yml
karel-rehor Sep 8, 2026
f70db2a
chore: add check for remote next release branch.
karel-rehor Sep 8, 2026
bea3059
docs: updated and proofed RELEASE.md
karel-rehor Sep 8, 2026
dafc3f3
chore: clarify error message.
karel-rehor Sep 8, 2026
3886aab
docs: add Maven Central step to releasing instructions.
karel-rehor Sep 8, 2026
b799c9a
chore: remove debug messages from on-release.sh
karel-rehor Sep 8, 2026
27e9568
chore: remove debug messages from maven-release.yml
karel-rehor Sep 8, 2026
0e21e5c
Merge branch 'InfluxCommunity:main' into ci/gh-action-maven-releasing
karel-rehor Sep 8, 2026
02183e1
chore: troubleshoot document releasing step
karel-rehor Sep 8, 2026
42877b5
chore: troubleshoot site publishing issue 02
karel-rehor Sep 8, 2026
c90cbae
chore: troubleshoot site publishing - set to global.
karel-rehor Sep 8, 2026
12464a8
chore: revert pubScmUrl - troubleshoot site publishing step.
karel-rehor Sep 8, 2026
aa5aaac
chore: troubleshoot sit publishing 03
karel-rehor Sep 8, 2026
d21ffce
chore: modify pubScmUrl to troubleshoot site publishing
karel-rehor Sep 8, 2026
bf81205
chore: troubleshoot site publishing 05
karel-rehor Sep 8, 2026
d7db961
chore: revert troubleshoot changes
karel-rehor Sep 8, 2026
34ec4c8
chore: troubleshoot site publishing 06
karel-rehor Sep 8, 2026
49d8666
chore: troubleshoot publish site documents.
karel-rehor Sep 9, 2026
bd772c6
chore: fix typo
karel-rehor Sep 9, 2026
13bc63e
chore: troubleshoot site document releasing 07
karel-rehor Sep 9, 2026
ee077b1
chore: troubleshoot site documentation 08
karel-rehor Sep 9, 2026
7eac1e3
chore: troubleshoot publish sit documentation 09
karel-rehor Sep 9, 2026
0ceeca9
chore: troubleshoot publish sit documentation 10
karel-rehor Sep 9, 2026
0d9c017
chore: troubleshoot publish sit documentation 11
karel-rehor Sep 9, 2026
823c132
chore: troubleshoot publish sit documentation 12
karel-rehor Sep 9, 2026
d3c750e
chore: troubleshoot publish sit documentation 13
karel-rehor Sep 9, 2026
396decb
chore: troubleshoot publish sit documentation 14
karel-rehor Sep 9, 2026
702a610
chore: troubleshoot publish sit documentation 15
karel-rehor Sep 9, 2026
727eb19
chore: troubleshoot publish sit documentation 16
karel-rehor Sep 9, 2026
28cecc2
chore: troubleshoot publish sit documentation 17
karel-rehor Sep 9, 2026
260418a
chore: troubleshoot publish sit documentation 18
karel-rehor Sep 9, 2026
992844f
chore: remove debug commands from Publish documentation step.
karel-rehor Sep 9, 2026
e542768
chore: experim - try automatic PR creation.
karel-rehor Sep 10, 2026
73dac4a
chore: experim - try to create new PR 02
karel-rehor Sep 10, 2026
4c0739a
chore: switch off automatic PR creation, requires special permissions.
karel-rehor Sep 10, 2026
e8e7b75
chore: reactivate branch controls for prerelease.
karel-rehor Sep 10, 2026
52c96b6
chore: add env checks for matching scm values.
karel-rehor Sep 10, 2026
d54457c
chore: fix path in script.
karel-rehor Sep 10, 2026
8f11019
chore: remove debug of script ENV.
karel-rehor Sep 10, 2026
9059208
chore: remove commented nodes from pom.xml
karel-rehor Sep 10, 2026
1d4a4ab
docs: update RELEASE.md to match current workflow.
karel-rehor Sep 10, 2026
cbefea3
chore: remove unnecessary commands from workflow.
karel-rehor Sep 10, 2026
ddeddf3
chore: prepare automated releasing branch for PR to upstream.
karel-rehor Sep 10, 2026
7c817c4
chore: remove experimental permissions from release workflow.
karel-rehor Sep 10, 2026
9130d11
docs: update CHANGELOG.md
karel-rehor Sep 10, 2026
3d958a8
docs: lint fixes for RELEASE.md
karel-rehor Sep 10, 2026
8afc194
docs: fix linting issues in RELEASE.md
karel-rehor Sep 14, 2026
2b58fee
docs: fixing lint issues in RELEASE.md 02
karel-rehor Sep 14, 2026
93ab125
docs: fix typos in RELEASE.md
karel-rehor Sep 14, 2026
620b863
chore: fixing lint issues in on-release.sh
karel-rehor Sep 14, 2026
21de1d6
chore: fix lint issues in maven-release.yml
karel-rehor Sep 14, 2026
4242886
chore: fix linter issue in maven-release.yml
karel-rehor Sep 14, 2026
199c93d
chore: revise pom version values to match upstream HEAD.
karel-rehor Sep 14, 2026
8325ce4
docs: anonymize commands in RELEASE.md
karel-rehor Sep 14, 2026
fb989d9
chore: fix typo in on-releas.sh, add reminder to check RC_OR_BETA tag…
karel-rehor Sep 14, 2026
4d90a18
chore: fix flaws in workflow and bash scripts.
karel-rehor Sep 14, 2026
335aac5
chore: use more meaningful user.email in workflow.
karel-rehor Sep 15, 2026
f7dd26c
chore: use current shell when calling on-release.sh in workflow
karel-rehor Sep 15, 2026
071979c
Merge branch 'InfluxCommunity:main' into ci/gh-action-maven-releasing
karel-rehor Sep 15, 2026
b4f8422
chore: fix RC or BETA release tag checks.
karel-rehor Sep 15, 2026
c9af311
chore: update trigger, fix snapshot credentials, verify workfow envars.
karel-rehor Sep 15, 2026
d5d68d8
chore: remove TODO and set RC_OR_BETA envar
karel-rehor Sep 15, 2026
8c12cd0
chore: fix typos add TODOs for fixes in on-release.sh
karel-rehor Sep 15, 2026
2a25e18
Merge branch 'InfluxCommunity:main' into ci/gh-action-maven-releasing
karel-rehor Sep 16, 2026
714d229
chore: improve checks in on-release.sh
karel-rehor Sep 16, 2026
c02677c
chore: better control sequencing, better checks in workflow.
karel-rehor Sep 16, 2026
8537d04
chore: fine tune release workflow and script.
karel-rehor Sep 16, 2026
a36fec1
chore: remove snapshot checks, revert workflow check for next working…
karel-rehor Sep 16, 2026
8084ad5
chore: fine tune behavior for patch releases.
karel-rehor Sep 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
248 changes: 248 additions & 0 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
name: Maven Releasing

on:

release:
types: [published]

jobs:
release:
permissions:
contents: write # may want to update version
runs-on: ubuntu-latest
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_SETTINGS_EXPERIM: ${{ vars.MAVEN_SETTINGS_FILE }}
GPG_PASSPHRASE_PRELIM: ${{ secrets.GPG_PASSPHRASE }}
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
IS_PRERELEASE: ${{ github.event.release.prerelease }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPO: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
cache: maven
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
Comment thread
karel-rehor marked this conversation as resolved.
- name: Add dependencies
run: |
sudo apt-get update
sudo apt-get -y install libxml2-utils
- name: Verify Env
run: |
if [[ -z "${{ secrets.GPG_PRIVATE_KEY }}" ]]
then
echo "ERROR GPG_PRIVATE_KEY is missing."
exit 1
fi
# ensure scm properties match current project - don't want to modify other repository inadvertently
POM_SITE_URL=$(xmllint --xpath "//*[local-name()='distributionManagement']/*[local-name()='site']/*[local-name()='url']/text()" ./pom.xml)
POM_SCM_CONNECTION=$(xmllint --xpath "//*[local-name()='scm']/*[local-name()='connection']/text()" ./pom.xml)
POM_SCM_DEVELOPER_CONNECTION=$(xmllint --xpath "//*[local-name()='scm']/*[local-name()='developerConnection']/text()" ./pom.xml)

if [[ ! "${POM_SITE_URL}" != "scm:git:https://github.com/${GITHUB_REPOSITORY}" ]]
then
echo "POM_SITE_URL ${POM_SITE_URL} does not match GITHUB_REPOSITORY ${GITHUB_REPOSITORY}"
exit 1
else
echo "POM_SITE_URL OK ✓."
fi

if [[ ! "${POM_SCM_CONNECTION}" =~ .*${GITHUB_REPOSITORY}\.git$ ]]
then
echo "POM_SCM_CONNECTION ${POM_SCM_CONNECTION} does not match GITHUB_REPOSITORY ${GITHUB_REPOSITORY}"
exit 1
else
echo "POM_SCM_CONNECTION OK ✓."
fi

if [[ ! "${POM_SCM_DEVELOPER_CONNECTION}" =~ .*${GITHUB_REPOSITORY}\.git$ ]]
then
echo "POM_SCM_DEVELOPER_CONNECTION ${POM_SCM_DEVELOPER_CONNECTION} does not match GITHUB_REPOSITORY ${GITHUB_REPOSITORY}"
exit 1
else
echo "POM_SCM_DEVELOPER_CONNECTION OK ✓."
fi

if [[ -n "$SONATYPE_USERNAME" ]]
then
echo "have SONATYPE_USERNAME"
else
echo "Release requires SONATYPE_USERNAME, which was not found. exiting"
exit 1
fi

if [[ -n "$SONATYPE_PASSWORD" ]]
then
echo "have SONATYPE_PASSWORD"
else
echo "Release requires SONATYPE_PASSWORD, which was not found. exiting"
exit 1
fi

if [[ -n "$GPG_PASSPHRASE_PRELIM" ]]
then
echo "have GPG_PASSPHRASE_PRELIM"
else
echo "Release requires GPG_PASSPHRASE, which was not found. exiting"
exit 1
fi

if [[ "$GPG_PASSPHRASE_PRELIM" == "EMPTY" ]]
then
echo "GPG_PASSPHRASE empty requested"
export GPG_PASSPHRASE=""
else
export GPG_PASSPHRASE="$GPG_PASSPHRASE_PRELIM"
fi

echo "GPG_PASSPHRASE=${GPG_PASSPHRASE}" >> "$GITHUB_ENV"

# Verify GPG2 environment
if ! command -v gpg2 &> /dev/null
then
echo "Failed to locate gpg2 on this host. GPG2 is required to continue."
exit 1
fi

gpg2 --version
GPG_EXECUTABLE=$(command -v gpg2)
export GPG_EXECUTABLE
echo "GPG_EXECUTABLE=${GPG_EXECUTABLE}" >> "$GITHUB_ENV"

# Verify tag and next version
if ! echo "${RELEASE_TAG_NAME}" | grep -Ei '^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|beta)[0-9]*)?$'
then
echo "RELEASE_TAG_NAME ${RELEASE_TAG_NAME} does not match expected pattern, e.g. (v1.9.0). Exiting."
exit 1
fi
VERSION_CLEAN="${RELEASE_TAG_NAME:1}"
# shellcheck disable=SC2206
PARTS=(${VERSION_CLEAN//./ })
# TODO Check if PARTS[2] starts with 0 or [1-9] if not 0 then this is hot release and should not trigger publishing
if ! echo "${PARTS[2]}" | grep -q "^0.*"
then
echo "Detected hot fix release ${RELEASE_TAG_NAME}"
echo "IS_HOT_FIX=true" >> "${GITHUB_ENV}"
Comment thread
karel-rehor marked this conversation as resolved.
fi
NEW_MINOR=$((PARTS[1]+1))
NEXT_RELEASE="${PARTS[0]}.${NEW_MINOR}.0"
echo "NEXT_RELEASE=${NEXT_RELEASE}" >> "${GITHUB_ENV}"
NEXT_RELEASE_BRANCH="ci/next-cycle-${NEXT_RELEASE}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config user.name "${GITHUB_ACTOR}"

if [[ "${IS_PRERELEASE}" != "true" && "${RELEASE_TAG_NAME,,}" =~ ^v[0-9]+\.[0-9]+\.0$ ]]
then
BRANCH_CHECK=$(git ls-remote --heads origin "refs/heads/${NEXT_RELEASE_BRANCH}")
if [ -n "${BRANCH_CHECK}" ]
then
echo "branch ${NEXT_RELEASE_BRANCH} already exists in project. Cannot recreate it automatically."
echo "If you wish to use this automatically created branch, please delete the existing branch and start the release again"
exit 1
fi
else
echo "Skipping next release cycle branch check because this is either a pre-release or a patch fix."
fi

echo "NEXT_RELEASE_BRANCH=${NEXT_RELEASE_BRANCH}" >> "$GITHUB_ENV"

- name: Script
run: |
. ./scripts/on-release.sh
echo "RC_OR_BETA=${RC_OR_BETA}" >> "$GITHUB_ENV"
- name: Release
run: |
if [[ "${IS_PRERELEASE}" == "true" ]]; then
echo "This is a pre release and will not be deployed to Maven Central."
exit 0
fi
if [[ "${RC_OR_BETA}" == "true" ]]
then
echo "This is an RC or BETA release and will not be deployed to Maven Central."
exit 0
fi
cat << EOF > release.properties
scm.url=scm\:git\:https\://github.com/${GITHUB_REPOSITORY}.git
scm.tag=${RELEASE_TAG_NAME}
EOF
cat release.properties
mvn release:perform \
-Dgoals=deploy \
-s ./deploy-settings.xml \
-Darguments="-DskipTests -DskipITs -DperformRelease=true"
- name: Prepare next cycle
run: |
if [[ "${IS_PRERELEASE}" == "true" ]]; then
echo "This is a prerelease so the next release cycle will not be prepared."
exit 0
fi
if [[ "${RC_OR_BETA}" == "true" ]]
then
echo "This is an RC or BETA release so next release cycle will not be prepared."
exit 0
fi
if [[ "${IS_HOT_FIX}" == "true" ]]
then
echo "This is a hot fix release ${RELEASE_TAG_NAME}, so next release cycle will not be prepared."
exit 0
fi

echo "Preparing next release cycle"

git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config user.name "${GITHUB_ACTOR}"
echo "checking out next release branch ${NEXT_RELEASE_BRANCH}"
git checkout -b "${NEXT_RELEASE_BRANCH}"
mvn versions:set-scm-tag -DnewTag="HEAD"
mvn versions:set -DnextSnapshot=true -DnextSnapshotIndexToIncrement=1
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 examples/pom.xml CHANGELOG.md
git commit -m "ci: setting up release cycle ${NEXT_RELEASE:1}"
git push --set-upstream origin "${NEXT_RELEASE_BRANCH}"
# The following requires special permissions on the organizational and project level to work. Switching off for now.
# gh pr create -B main -H ${NEXT_RELEASE_BRANCH} --title "Merge ${NEXT_RELEASE_BRANCH} into main" --body 'Created by Github action'
# The alternative is to create the PR by hand
echo "The branch ${NEXT_RELEASE_BRANCH} has been created. You can create and merge a PR manually from it to start the next release cycle."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish documentation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ "${IS_PRERELEASE}" == "true" ]]; then
echo "This is a pre release, so site documentation will not be updated to Github pages."
exit 0
fi
if [[ "${RC_OR_BETA}" == "true" ]]
then
echo "This is an RC or BETA release, so site documentation will not be updated to Github pages."
exit 0
fi
if [[ "${IS_HOT_FIX}" == "true" ]]
then
echo "This is a hot fix release ${RELEASE_TAG_NAME}, so site documentation will not be updated to Github pages."
exit 0
fi
cat << EOF > scm-settings.xml
<settings>
<servers>
<server>
<id>github</id>
<username>x-access-token</username>
<password>${GITHUB_TOKEN}</password>
</server>
</servers>
</settings>
EOF
git config --global user.email "${GITHUB_TRIGGERING_ACTOR}@noreply.github.com"
git config --global user.name "Github Action"
git checkout "${RELEASE_TAG_NAME}"
mvn clean site site:stage -DskipTests
mvn -s scm-settings.xml --batch-mode scm-publish:publish-scm -Dscmpublish.serverId=github
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## 1.12.0 [unreleased]

### CI

1. [#440](https://github.com/InfluxCommunity/influxdb3-java/pull/440): Sets up automated releasing to Maven Central

## 1.11.0 [2026-08-27]

### Breaking Changes
Expand Down
Loading
Loading