Skip to content
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
4f6ae2c
feat: adding maven support
mirzakaracic Nov 12, 2025
e9d98e7
ci: added java and maven support to execute build
mirzakaracic Nov 13, 2025
66e70d1
fix: removed changes for pom version handling
mirzakaracic Nov 13, 2025
4360e1d
fix: fix comment on input variable
mirzakaracic Nov 13, 2025
6618995
fix: added support for jar files
mirzakaracic Nov 14, 2025
ecd6c6b
fix: fix to finvoke jar package handling in entrypoint.sh
mirzakaracic Nov 14, 2025
9a7dd34
fix: added missing logic for jar files
mirzakaracic Nov 15, 2025
bf1a8d5
fix: fixed pathing for maven
mirzakaracic Nov 15, 2025
760ac27
fix: updated structure_build_artifact
mirzakaracic Nov 15, 2025
4311f4a
fix: trying to use specific version of deploy entrypoint.sh script
mirzakaracic Nov 15, 2025
20b5c89
fix: added deubug to entrypoint
mirzakaracic Nov 15, 2025
52354f7
fix: typo in package_utils
mirzakaracic Nov 15, 2025
04dee2f
fix: removed deubug
mirzakaracic Nov 15, 2025
5a4c970
fix: added ability to follow maven deploy artifact layout
mirzakaracic Nov 15, 2025
f71bdad
fix: added missing files for maven artifacts
mirzakaracic Nov 15, 2025
a0fbf51
fix: removed redundant logc
mirzakaracic Nov 15, 2025
66d88b9
fix: removed call on missing function
mirzakaracic Nov 15, 2025
d5059c9
Update .github/workflows/deploy-artifacts/package_utils.sh
mirzakaracic Nov 18, 2025
efee883
Update .github/workflows/deploy-artifacts/entrypoint.sh
mirzakaracic Nov 18, 2025
84f92b7
Update .github/workflows/deploy-artifacts/entrypoint.sh
mirzakaracic Nov 18, 2025
9e3f228
fix: pr comment fixes
mirzakaracic Nov 18, 2025
6c8016d
Update .github/workflows/deploy-artifacts/package_utils.sh
mirzakaracic Nov 18, 2025
6f190d7
fix: addressing how we extract package name and version from jar file…
mirzakaracic Nov 18, 2025
00b1156
Merge branch 'main' into feature/CLIENT-3877-add-maven
arrowplum Nov 20, 2025
1421c04
fix(workflows): use valid files and update tests to expect JAR uploa…
arrowplum Nov 20, 2025
709a7ef
feat: adding maven support
mirzakaracic Nov 12, 2025
9bd158b
ci: added java and maven support to execute build
mirzakaracic Nov 13, 2025
b875b6e
fix: removed changes for pom version handling
mirzakaracic Nov 13, 2025
0c29d16
fix: fix comment on input variable
mirzakaracic Nov 13, 2025
abdd11d
fix: added support for jar files
mirzakaracic Nov 14, 2025
4d2ad10
fix: fix to finvoke jar package handling in entrypoint.sh
mirzakaracic Nov 14, 2025
3d1b50c
fix: added missing logic for jar files
mirzakaracic Nov 15, 2025
624d7f1
fix: fixed pathing for maven
mirzakaracic Nov 15, 2025
f1b077d
fix: updated structure_build_artifact
mirzakaracic Nov 15, 2025
3179674
fix: trying to use specific version of deploy entrypoint.sh script
mirzakaracic Nov 15, 2025
563b9bd
fix: added deubug to entrypoint
mirzakaracic Nov 15, 2025
5036858
fix: typo in package_utils
mirzakaracic Nov 15, 2025
92da7a9
fix: removed deubug
mirzakaracic Nov 15, 2025
34fc2f8
fix: added ability to follow maven deploy artifact layout
mirzakaracic Nov 15, 2025
cac6281
fix: added missing files for maven artifacts
mirzakaracic Nov 15, 2025
59c4e69
fix: removed redundant logc
mirzakaracic Nov 15, 2025
45e0472
fix: removed call on missing function
mirzakaracic Nov 15, 2025
bd3e412
Update .github/workflows/deploy-artifacts/package_utils.sh
mirzakaracic Nov 18, 2025
1ab3a66
Update .github/workflows/deploy-artifacts/entrypoint.sh
mirzakaracic Nov 18, 2025
47ccd65
Update .github/workflows/deploy-artifacts/entrypoint.sh
mirzakaracic Nov 18, 2025
87567de
fix: pr comment fixes
mirzakaracic Nov 18, 2025
474e88a
Update .github/workflows/deploy-artifacts/package_utils.sh
mirzakaracic Nov 18, 2025
47736d9
fix: addressing how we extract package name and version from jar file…
mirzakaracic Nov 18, 2025
d02839b
Merge branch 'CLIENT-3877' into feature/CLIENT-3877-add-maven
arrowplum Nov 21, 2025
a640455
fix: update fixtures and adjust to allow processing nuget
arrowplum Nov 21, 2025
0b31646
docs: gtammar
arrowplum Nov 21, 2025
9903ca3
docs: comment should match refactor
arrowplum Nov 21, 2025
11715e8
docs: comment should match refactor
arrowplum Nov 21, 2025
f864dac
fix: update NuGet repository references in entrypoint.sh and test_nup…
arrowplum Nov 21, 2025
0aa2243
Merge pull request #96 from aerospike/feature/CLIENT-3877-add-maven
mirzakaracic Nov 21, 2025
ca55760
fix(workflows): nupkg are now not generic
arrowplum Nov 21, 2025
865a8e4
fix: removed comments that could lead to confusion. Added support for…
mirzakaracic Nov 22, 2025
57db2ff
fix: made --jar-group-id for entrypoint.sh
mirzakaracic Nov 22, 2025
2b2be43
fix: fixed tests to accomodated new logic
mirzakaracic Nov 22, 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
72 changes: 70 additions & 2 deletions .github/workflows/deploy-artifacts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ structure_build_artifacts() {
echo "current files: $(ls -la build-artifacts)" >&2
mkdir -p structured_build_artifacts/deb
mkdir -p structured_build_artifacts/rpm
mkdir -p structured_build_artifacts/jar
mkdir -p structured_build_artifacts/generic
while IFS= read -r -d '' deb; do
if [[ ! -f "$deb" ]]; then
Expand All @@ -145,14 +146,24 @@ structure_build_artifacts() {
done < <(find build-artifacts -name "*.rpm" -print0)
echo "current files: $(ls -la build-artifacts)" >&2

while IFS= read -r -d '' jar; do
if [[ ! -f "$jar" ]]; then
continue
fi

echo "Processing JAR: $jar" >&2
process_jar "$jar" "./structured_build_artifacts/jar"
done < <(find build-artifacts -name "*.jar" -print0)
echo "current files: $(ls -la build-artifacts)" >&2

while IFS= read -r -d '' generic; do
if [[ ! -f "$generic" ]]; then
echo "Skipping non-file: $generic" >&2
continue
fi
echo "Processing generic file: $generic" >&2
process_generic "$generic" "./structured_build_artifacts/generic"
done < <(find build-artifacts \( -not -name "*.deb" -not -name "*.rpm" -not -name "*.asc" \) -type f -print0)
done < <(find build-artifacts \( -not -name "*.deb" -not -name "*.rpm" -not -name "*.asc" -not -name "*.jar" \) -type f -print0)
}

upload_deb_packages() {
Expand Down Expand Up @@ -232,6 +243,60 @@ upload_rpm_packages() {
done < <(find . -name "*.rpm" -print0)
}

upload_jar_packages() {
if [[ "$DRY_RUN" == "true" ]]; then
echo "Would upload JAR/POM packages to JFrog..." >&2
else
echo "Uploading JAR/POM packages to JFrog..." >&2
fi

# Find all JAR and POM files, then process unique base names
declare -A processed_artifacts

while IFS= read -r -d '' artifact; do
if [[ ! -f "$artifact" ]]; then
continue
fi

# Get the directory and base name
artifact_dir=$(dirname "$artifact")
artifact_name=$(basename "$artifact")
base_name="${artifact_name%.jar}"
base_name="${base_name%.pom}"

# Skip if we've already processed this base artifact
artifact_key="$artifact_dir/$base_name"
if [[ -n "${processed_artifacts[$artifact_key]:-}" ]]; then
continue
fi
processed_artifacts[$artifact_key]=1

# Determine which file to use for metadata extraction (prefer POM as it's the source of truth)
local pkgname version group_id

# Fallback: Extract metadata from JAR if no POM exists
read -r -a metadata < <(get_jar_metadata "$artifact_dir/${base_name}.jar")
pkgname="${metadata[0]}"
version="${metadata[1]}"
group_id="${metadata[2]}"

echo " Package: $pkgname, Version: $version, Group ID: $group_id" >&2

# Upload all related Maven artifact files (jar, pom, signatures)
for ext in jar pom jar.asc pom.asc; do
local artifact_file="$artifact_dir/${base_name}.${ext}"
if [[ -f "$artifact_file" ]]; then
echo " Uploading $ext: $artifact_file" >&2
run jf rt upload "$artifact_file" "$PROJECT-maven-dev-local" --flat=false \
--build-name="$BUILD_NAME" \
--build-number="$ARTIFACT_BUILD_NUMBER" \
--project="$PROJECT" \
--target-props "group_id=$group_id;package_name=$pkgname;version=$version"
fi
done
done < <(find . \( -name "*.jar" -o -name "*.pom" \) -print0)
}

upload_generic_files() {
if [[ "$DRY_RUN" == "true" ]]; then
echo "Would upload generic files..." >&2
Expand All @@ -249,7 +314,7 @@ upload_generic_files() {
--build-number="$ARTIFACT_BUILD_NUMBER" \
--project="$PROJECT"
fi
done < <(find . \( -not -name "*.deb" -not -name "*.rpm" -not -name "*.asc" \) -print0)
done < <(find . \( -not -name "*.deb" -not -name "*.rpm" -not -name "*.asc" -not -name "*.jar" \) -print0)
}


Expand Down Expand Up @@ -351,6 +416,9 @@ main() {
cd deb
upload_deb_packages
cd ..
cd jar
upload_jar_packages
cd ..
cd generic
upload_generic_files
cd ..
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/deploy-artifacts/package_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@
exit 1
}

# Function to extract JAR metadata
get_jar_metadata() {
local jar="$1"
local filename="${jar##*/}" # Get just the filename without path
local pkgname version group_id

pkgname=$(echo "$filename" | sed 's/-[0-9.]*\.jar$//')

Check notice on line 19 in .github/workflows/deploy-artifacts/package_utils.sh

View workflow job for this annotation

GitHub Actions / Trunk Check

shellcheck(SC2001)

[new] See if you can use ${variable//search/replace} instead.
version=$(echo "$filename" | sed 's/.*-//' | sed 's/\.jar$//')
group_id=$(unzip -Z1 "$jar" \
| awk '/pom\.properties$/ {print; exit}' \
| xargs -r -I{} unzip -p "$jar" "{}" \
| grep '^groupId=' \
| cut -d= -f2)

# Return package name and version
echo "$pkgname $version $group_id"
}

# Function to extract RPM metadata and distribution
# Unlike for debs this requires parsing the name (because the distro name is not standard)
get_rpm_metadata() {
Expand Down Expand Up @@ -59,6 +77,45 @@
cp -v "$rpm" "$target/$rpm_name" >&2
}

process_jar() {
local jar="$1"
local dest_dir="$2"
local -a metadata
local pkgname version group_id group_path

# Get metadata using the new function
read -r -a metadata < <(get_jar_metadata "$jar")
pkgname="${metadata[0]}"
version="${metadata[1]}"
group_id="${metadata[2]}"
group_path="${group_id//./\/}"

local target="$dest_dir/$group_path/$pkgname/$version"
echo "DEBUG: Creating directory structure:" >&2
echo " Group id: $group_id" >&2
echo " Package name: $pkgname" >&2
echo " Version: $version" >&2
mkdir -p "$target"

# Get the directory and base name of the jar file
local jar_dir
local jar_name
local base_name
jar_dir=$(dirname "$jar")
jar_name=$(basename "$jar")
base_name="${jar_name%.jar}" # Remove .jar extension

echo "Copying Maven artifacts to: $target" >&2

# Copy jar, pom, and asc files
for ext in jar pom jar.asc pom.asc; do
local file="$jar_dir/${base_name}.${ext}"
if [[ -f "$file" ]]; then
cp -v "$file" "$target/" >&2
fi
done
}

get_codename_for_deb() {
case "$1" in
*ubuntu20.04*) echo "focal" ;;
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable_deploy-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ jobs:
with:
name: ${{ inputs.gh-artifact-name }}
path: ./build-artifacts

- name: Verify artifacts
shell: bash
run: |
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/reusable_execute-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,28 @@ on:
type: string
default: .

# Java/Maven setup
setup-java:
description: Whether to set up Java environment
required: false
type: boolean
default: false
java-version:
description: Java version to set up (e.g., "17", "21")
required: false
type: string
default: "21"
java-distribution:
description: Java distribution (temurin, zulu, adopt, corretto, etc.)
required: false
type: string
default: temurin
java-cache:
description: Package manager to cache (maven, gradle, sbt).
required: false
type: string
default: maven

outputs:
gh-artifact-name:
description: The name of the uploaded artifacts on github
Expand Down Expand Up @@ -146,6 +168,14 @@ jobs:
submodules: recursive
fetch-depth: 1

- name: Set up Java
if: inputs.setup-java
uses: actions/setup-java@v4
with:
distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
cache: ${{ inputs.java-cache }}

- name: Set up JFrog CLI
uses: jfrog/setup-jfrog-cli@5b06f730cc5a6f55d78b30753f8583454b08c0aa # v4.8.1
env:
Expand Down
Loading