Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
7420b86
updated javadoc parsing logic
gagan405 Dec 5, 2025
6f44b54
update commit hash
gagan405 Dec 8, 2025
8effb30
add missing variable
gagan405 Dec 8, 2025
fe48c70
add missing variable
gagan405 Dec 8, 2025
85aa03e
add missing variable
gagan405 Dec 8, 2025
4782328
porting publish scripts from hava client
gagan405 Dec 8, 2025
514b6dd
fixed project name, cleaned up jdk versioning
gagan405 Dec 9, 2025
cad18b9
remove git hash from ueses reference
gagan405 Dec 9, 2025
bda2344
comment out any update code for testing
gagan405 Dec 9, 2025
fa5dfa2
add wf run against pull request
gagan405 Dec 9, 2025
3a877d4
hard code build number
gagan405 Dec 9, 2025
dad401f
fix working directory, add debug statements
gagan405 Dec 9, 2025
4e55324
fix parsing commit hash, promote build only for the root name
gagan405 Dec 9, 2025
3b62340
fix build name
gagan405 Dec 10, 2025
83d7634
fix build name
gagan405 Dec 10, 2025
2dca316
remove multi-module to single one
gagan405 Dec 10, 2025
a762246
force GH to find the wf in PR branch
gagan405 Dec 10, 2025
6e28e83
fix build name number for the next stage
gagan405 Dec 10, 2025
6f1d672
output artifact version as single string
gagan405 Dec 10, 2025
e4fda14
change build name to match the maven artifact
gagan405 Dec 10, 2025
1b8ae36
update build script to reflect latest changes
gagan405 Dec 10, 2025
92f03e6
update build script to reflect latest changes
gagan405 Dec 10, 2025
a0ce053
update gh workflow and add build info
gagan405 Dec 10, 2025
0d54c82
update gh workflow commit
gagan405 Dec 10, 2025
bf4786f
still update gh workflow commit
gagan405 Dec 10, 2025
73816cd
remove vcs info
gagan405 Dec 10, 2025
69291ec
revert to main branch
gagan405 Dec 10, 2025
0d4c2a8
test with build 22
gagan405 Dec 10, 2025
a3adfb1
updated artifact extraction logic
gagan405 Dec 10, 2025
634af3b
updated build-name parsing
gagan405 Dec 10, 2025
2dd7215
updated download logic
gagan405 Dec 10, 2025
1ca9849
add debug logs
gagan405 Dec 10, 2025
27caae8
extract artifact name from path
gagan405 Dec 10, 2025
4a478fe
fix input to sonatype step
gagan405 Dec 10, 2025
9b8954e
pass artifact version to sonatype step
gagan405 Dec 10, 2025
93d9b06
add debug logs for sonatype response
gagan405 Dec 10, 2025
c2c96ea
add debug logs for sonatype response
gagan405 Dec 10, 2025
5b39186
test sonatype with dummy id
gagan405 Dec 10, 2025
7106abc
update version extraction
gagan405 Dec 10, 2025
96599ef
fix version extraction
gagan405 Dec 10, 2025
d375cc4
fix version extraction
gagan405 Dec 10, 2025
e8a0190
debug fix version extraction
gagan405 Dec 10, 2025
385c590
use maven to extract version
gagan405 Dec 10, 2025
8119a12
minor fix: use maven to extract version
gagan405 Dec 10, 2025
5a99854
enable java in version extraction
gagan405 Dec 10, 2025
49babed
attempt to fix with sed
gagan405 Dec 10, 2025
c24cbb8
fix artifact path
gagan405 Dec 10, 2025
fc9be50
fix SNAPSHOT versions in build
gagan405 Dec 10, 2025
5c0495e
update build logic to fix snapshot version
gagan405 Dec 10, 2025
affe894
include parent pom
gagan405 Dec 10, 2025
fb1d9f6
update wf commit to handle SNAPSHOT javadoc jars
gagan405 Dec 10, 2025
2e64681
update wf version
gagan405 Dec 11, 2025
99d5f0b
update wf hash to handle parent pom
gagan405 Dec 11, 2025
9bc1683
update wf hash to handle xmllint
gagan405 Dec 11, 2025
d430a95
update wf hash to handle xmllint
gagan405 Dec 11, 2025
c6155ad
another upgrade to shared wf
gagan405 Dec 11, 2025
6d48e2a
yet another attempt to fix the wf
gagan405 Dec 11, 2025
18b63e8
upgrade wf version
gagan405 Dec 11, 2025
9cbc8e7
test with build 42
gagan405 Dec 11, 2025
0c2dfd3
disable sonatype probing for test
gagan405 Dec 11, 2025
1378d01
fix checking is-snapshot from build_info
gagan405 Dec 11, 2025
16a32fa
temporarily enable snapshot promotion
gagan405 Dec 11, 2025
15300e6
remove trigger on main branch
gagan405 Dec 11, 2025
556776e
uncomment the commented portions
gagan405 Dec 11, 2025
1242559
add sonatype delete/approve workflow
gagan405 Dec 11, 2025
a1d2fa1
fix: remove promotion flow on pull requests
gagan405 Dec 11, 2025
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
24 changes: 18 additions & 6 deletions .github/actions/get-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ runs:
id: get-is-snapshot
shell: bash
run: |
# Check if tagged with release or release candidate
TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || echo "")

if [[ "$TAG" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Production release tag detected: $TAG"
echo "is-snapshot=false" >> $GITHUB_OUTPUT
exit 0
elif [[ "$TAG" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+$ ]]; then
echo "Release candidate tag detected: $TAG"
echo "is-snapshot=false" >> $GITHUB_OUTPUT
exit 0
fi

# Getting previous commit
COMMIT_REF="HEAD~1"

Expand All @@ -20,26 +33,25 @@ runs:
fi

# Getting previous version
OLD_VERSIONS=$(git show "${COMMIT_REF}:pom.xml" |
sed -n '/<revision>/ { s/.*<revision>\([^<]*\)<\/revision>.*/\1/p; q }')
OLD_VERSIONS=$(git show "${COMMIT_REF}:pom.xml" | sed -n '0,/<version>/ s/.*<version>\([^<]*\)<\/version>.*/\1/p')

# Getting current version
NEW_VERSIONS=$(sed -n 's/.*<revision>\([^<]*\)<\/revision>.*/\1/p' pom.xml)
NEW_VERSIONS=$(sed -n '0,/<version>/ s/.*<version>\([^<]*\)<\/version>.*/\1/p' pom.xml)

echo "old versions: ${OLD_VERSIONS}, new versions: ${NEW_VERSIONS}"
# Compare the extracted versions. CI will not commit snapshot version.
if [[ "${OLD_VERSIONS}" != "${NEW_VERSIONS}" ]]; then
echo "is-snapshot='false'" >> $GITHUB_OUTPUT
echo "is-snapshot=false" >> $GITHUB_OUTPUT
else
echo "is-snapshot='true'" >> $GITHUB_OUTPUT
echo "is-snapshot=true" >> $GITHUB_OUTPUT
fi

- name: Get release or snapshot-version
id: get-release-version
shell: bash
run: |
IS_SNAPSHOT=${{ steps.get-is-snapshot.outputs.is-snapshot }}
if [ $IS_SNAPSHOT == 'true' ];then
if [ $IS_SNAPSHOT == "true" ];then
echo release-version="$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-SNAPSHOT_$GITHUB_SHA" >> $GITHUB_OUTPUT
else
echo release-version="$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
Expand Down
63 changes: 63 additions & 0 deletions .github/actions/publish-build-info-to-jfrog/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Publish build-info to JFrog
description: "Publishes build-info to JFrog"

inputs:
jfrog-platform-url:
description: "JFrog platform URL"
required: false
default: https://aerospike.jfrog.io
oidc-provider:
description: "OIDC provider name"
required: true
oidc-audience:
description: "ODIC audience"
required: true
build-path:
description: "Path to which build info is to be published"
required: true
variables:
description: "Any additional variables to be published as part of build. The input here should be valid JSON in the form {'env_variable_key': 'env_variable_value'}, .e.g {'SONATYPE_STAGING_BUILD_ID': '070c07e25e937888ed9740ee825afa24bf184722'}"
required: true

runs:
using: "composite"
steps:
- name: Debug publish to github
shell: bash
run: |
echo "${{ inputs.jfrog-platform-url }}"
echo "${{ inputs.build-path }}"

- name: Set up JFrog credentials
id: setup-jfrog-cli
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ inputs.jfrog-platform-url }}
JF_PROJECT: database
with:
version: 2.72.2
oidc-provider-name: ${{ inputs.oidc-provider }}
oidc-audience: ${{ inputs.oidc-audience }}

# Parsing out env variables and values and setting them in the environment
- name: Set env variables provided with variables
shell: bash
run: |
ENV_VARIABLES='${{ inputs.variables }}'
echo "$ENV_VARIABLES" | jq -r 'to_entries | .[] | "\(.key)=\(.value)"' >> $GITHUB_ENV

# Pushing build info to JFrog
- name: Upload artifacts
shell: bash
run: |
BUILD_ID=$(echo "${{ inputs.build-path }}" | sed 's/.*_\(.*\)\/.*/\1/')
BUILD_PATH="promote_${BUILD_ID}"

# record env variables
jf rt bce ${BUILD_PATH} ${{ github.run_number }}

# record git info
jf rt bag ${BUILD_PATH} ${{ github.run_number }}

# publish build info
jf rt bp ${BUILD_PATH} ${{ github.run_number }}
91 changes: 91 additions & 0 deletions .github/actions/publish-to-github/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Publish artifacts to github
description: "Publish artifacts to github"

inputs:
staging-folder:
description: ""
required: false
default: staging
target-folder:
description: ""
required: false
default: github
release-notes:
description: "Release notes"
required: true
github-token:
description: "Github auth token"
required: true
artifact-version:
description: "Version of the artifact to release"
required: true
build-name-number:
description: "String containing build name, number and jdk versions"
required: true

runs:
using: "composite"
steps:
- name: Debug publish to github
shell: bash
run: |
echo "${{ inputs.staging-folder }}"
echo "${{ inputs.target-folder }}"
echo "${{ inputs.artifact-version }}"
echo "${{ inputs.release-notes }}"
echo "${{ inputs.build-name-number }}"

- id: get-artifact-version
shell: bash
run: |
VERSION="${{ inputs.artifact-version }}"
echo "artifact-version=${VERSION}" >> $GITHUB_OUTPUT

- name: Create upload archive for github
id: create-artifact
shell: bash
run: |
src="${{ inputs.staging-folder }}"
dest="${{ inputs.target-folder }}"

find "$src" -type f \
-exec cp {} "$dest" \;

# Listing staged artifacts to be uploaded
- id: get-github-release-artifact-names
working-directory: ${{ inputs.target-folder }}
shell: bash
run: |
ARTIFACTS=$(ls | sed "s|^|${{ inputs.target-folder }}/|")

echo "release-artifacts<<EOF" >> $GITHUB_OUTPUT
echo "${ARTIFACTS}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Debug show content of the upload archive
shell: bash
run: |
pwd
ls ${{ inputs.target-folder }} | sed 's/^//'

- name: Debug GitHub publish input
shell: bash
working-directory: ${{ inputs.target-folder }}
run: |
echo "working directory: ${{ inputs.target-folder }}"
echo "tag name: Release ${{ steps.get-artifact-version.outputs.artifact-version }}"
echo "body: Changes for release ${{ steps.get-artifact-version.outputs.artifact-version }}"
echo "body: ${{ inputs.release-notes }}"
echo "files: ${{ steps.get-github-release-artifact-names.outputs.release-artifacts }}"

- name: Publish release to github
uses: softprops/action-gh-release@v2
with:
token: ${{ inputs.github-token }}
tag_name: ${{ steps.get-artifact-version.outputs.artifact-version }}
body: |
Changes for release ${{ steps.get-artifact-version.outputs.artifact-version }}
${{ inputs.release-notes }}
draft: true
prerelease: false
files: ${{ steps.get-github-release-artifact-names.outputs.release-artifacts }}
158 changes: 158 additions & 0 deletions .github/actions/publish-to-sonatype/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: Publish artifacts to Sonatype
description: "Publishes artifacts to Sonatype"

inputs:
staging-folder:
description: "Folder to which the artifacts are copied"
required: false
default: staging
target-folder:
description: "Subfolder in the staging folder where the artifacts are copied"
required: false
default: sonatype
publish-user:
description: "Username for publishing to Sonatype"
required: true
publish-password:
description: "Password for publishing to Sonatype"
required: true
validation-max-number-checks:
description: "Number of checks we will conduct to check if the package is validated"
required: true
sonatype-domain-name:
description: "Sonatype domain name"
required: true
build-name-number:
required: true
description: "Build name and number"
artifact-version:
description: "Artifact version"
required: true

outputs:
maven-central-release-id:
description: Maven central id extracted from staging step to maven central
value: ${{ steps.get-maven-central-release-id.outputs.maven-central-release-id }}

runs:
using: "composite"
steps:
- name: Debug publish to github
shell: bash
run: |
echo "${{ inputs.staging-folder }}"
echo "${{ inputs.target-folder }}"
echo "${{ inputs.sonatype-domain-name }}"
echo "${{ inputs.build-name-number }}"
echo "${{ inputs.artifact-version }}"

# For Maven Central we need to filter out the jar-with-dependencies
# as it is not allowed to be uploaded to Maven Central
- name: Copy artifacts with filter to sonatype stage folder
shell: bash
working-directory: ${{ inputs.staging-folder }}
run: |
src="./"
dest=../"${{ inputs.target-folder }}"

find "$src" -type f \
\! \( -name "*jar-with-dependencies*" \) \
-exec cp --parents {} "$dest" \;

- name: Debug target folder contents
shell: bash
working-directory: ${{ inputs.target-folder }}
run: |
echo "Current directory: $(pwd)"
echo "Contents:"
ls -laR

# Creates uploadable archive
- name: Create upload archive for sonatype
id: create-artifact
shell: bash
working-directory: ${{ inputs.target-folder }}
run: |
# Use the actual artifact version, not parsed from build-name-number
RELEASE="${{ inputs.artifact-version }}"
# Extract just the build number from build-name-number
RELEASE_BUILD_NUMBER=$(echo "${{ inputs.build-name-number }}" | sed -E 's/.*\/([^/]+)$/\1/')
ARTIFACT_NAME="${RELEASE}_${RELEASE_BUILD_NUMBER}"

echo "artifact-name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT
zip -r "${ARTIFACT_NAME}" .

- name: Debug show content of the upload archive
shell: bash
working-directory: ${{ inputs.target-folder }}
run: |
ARTIFACT_NAME='${{ steps.create-artifact.outputs.artifact-name }}'
unzip -l "${ARTIFACT_NAME}" | tail -n +4 | sort -k4,4

# Call to Maven Central to stage the release/artifact
- name: Stage artifacts
id: stage-release
working-directory: ${{ inputs.target-folder }}
shell: bash
run: |
TOKEN=$(printf "${{ inputs.publish-user }}:${{ inputs.publish-password }}" | base64)

echo "curl --request POST --verbose --header 'Authorization: Bearer ${TOKEN}' --form bundle=@${{ steps.create-artifact.outputs.artifact-name }}.zip ${{ inputs.sonatype-domain-name }}/api/v1/publisher/upload?publishingType=USER_MANAGED"
echo stage-release-id=$(curl --request POST --silent --header "Authorization: Bearer ${TOKEN}" --form bundle=@${{ steps.create-artifact.outputs.artifact-name }}.zip ${{ inputs.sonatype-domain-name }}/api/v1/publisher/upload?publishingType=USER_MANAGED) >> $GITHUB_OUTPUT

# Validation check loop
- name: Check validation
working-directory: ${{ inputs.target-folder }}
shell: bash
run: |
# Correct: Sonatype Publisher API uses Basic auth, not Bearer
TOKEN=$(printf "%s:%s" "${{ inputs.publish-user }}" "${{ inputs.publish-password }}" | base64)

NUMBER_OF_CHECKS=${{ inputs.validation-max-number-checks }}

echo "Starting Sonatype validation checks (max: ${NUMBER_OF_CHECKS})"

for ((i = 1; i <= NUMBER_OF_CHECKS; i++)); do
RESPONSE=$(curl --verbose --show-error \
--request POST \
--header "Authorization: Bearer ${TOKEN}" \
"${{ inputs.sonatype-domain-name }}/api/v1/publisher/status?id=${DUMMY_ID}")

# Validate JSON and extract deploymentState
SONATYPE_RESPONSE=$(echo "${RESPONSE}" | jq -r '.deploymentState // "NULL"')

if [[ "${SONATYPE_RESPONSE}" == "FAILED" ]]; then
ERRORS=$(echo "${RESPONSE}" | jq '.errors // "Unknown error"')
echo "Package validation failed."
echo "Errors: ${ERRORS}"
exit 1

elif [[ "${SONATYPE_RESPONSE}" == "VALIDATING" || "${SONATYPE_RESPONSE}" == "PENDING" ]]; then
echo "Package validation is not done. Status: ${SONATYPE_RESPONSE}"

# Exponential backoff
sleep_time=$((2 ** (i - 1)))
echo "Next retry in ${sleep_time} seconds..."
sleep "${sleep_time}"

elif [[ "${SONATYPE_RESPONSE}" == "VALIDATED" ]]; then
echo "Package successfully validated."
exit 0

else
echo "Unknown response from Sonatype: ${SONATYPE_RESPONSE}"
echo "Full payload:"
echo "${RESPONSE}"
fi
done

echo "Validation timed out after ${NUMBER_OF_CHECKS} attempts."
exit 1

# Peculating up the maven central release id
- name: Maven Central release id
working-directory: ${{ inputs.target-folder }}
id: get-maven-central-release-id
shell: bash
run: |
echo "maven-central-release-id=${{ steps.stage-release.outputs.stage-release-id }}" >> $GITHUB_OUTPUT
Loading