This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new 3189fac962 ci: Simplify compute third-party cache key step
3189fac962 is described below
commit 3189fac9627b9dbca6dbc0a759057c02e0985a3a
Author: James Netherton <[email protected]>
AuthorDate: Thu Jun 18 11:09:05 2026 +0100
ci: Simplify compute third-party cache key step
On camel-main the root POM parent is camel-dependencies SNAPSHOT which
is not yet published to any remote repository. Using ./mvnw help:evaluate
to resolve properties fails because Maven cannot download the snapshot
parent.
Move the key computation into setup-maven-cache as the default behaviour:
when no cache-key or maven-properties inputs are provided the action greps
the Camel parent version and quarkiverse-cxf.version directly from pom.xml,
covering all Camel-managed dependencies without invoking Maven.
This removes the duplicated Compute third-party cache key step from
ci-build.yaml, camel-master-cron.yaml, and pr-validate.yml.
Co-authored-by: Claude Sonnet 4.6 (1M context) <[email protected]>
---
.github/actions/setup-maven-cache/action.yaml | 7 ++++++-
.github/workflows/camel-master-cron.yaml | 11 -----------
.github/workflows/ci-build.yaml | 15 ---------------
.github/workflows/pr-validate.yml | 4 ----
4 files changed, 6 insertions(+), 31 deletions(-)
diff --git a/.github/actions/setup-maven-cache/action.yaml
b/.github/actions/setup-maven-cache/action.yaml
index 9a3318d48b..47b3ebd29b 100644
--- a/.github/actions/setup-maven-cache/action.yaml
+++ b/.github/actions/setup-maven-cache/action.yaml
@@ -60,7 +60,7 @@ runs:
run: |
if [[ -n "${PROVIDED_KEY}" ]]; then
echo "key=${PROVIDED_KEY}" >> $GITHUB_OUTPUT
- else
+ elif [[ -n "${MAVEN_PROPERTIES}" ]]; then
VALS=""
while IFS= read -r PROP; do
PROP="${PROP//[[:space:]]/}"
@@ -70,6 +70,11 @@ runs:
done <<< "${MAVEN_PROPERTIES}"
HASH=$(printf "${VALS}" | sha256sum | cut -c1-16)
echo "key=third-party-maven-${HASH}" >> $GITHUB_OUTPUT
+ else
+ CAMEL_VER=$(grep -m1 '<version>' "${POM_PATH}" | sed
's|.*<version>\(.*\)</version>.*|\1|' | tr -d ' ')
+ CXF_VER=$(grep -m1 '<quarkiverse-cxf\.version>' "${POM_PATH}" | sed
's|.*<quarkiverse-cxf\.version>\(.*\)</quarkiverse-cxf\.version>.*|\1|' | tr -d
' ')
+ HASH=$(printf "${CAMEL_VER}\n${CXF_VER}\n" | sha256sum | cut -c1-16)
+ echo "key=third-party-maven-${HASH}" >> $GITHUB_OUTPUT
fi
- name: Restore Maven Cache
if: ${{ inputs.action == 'restore' }}
diff --git a/.github/workflows/camel-master-cron.yaml
b/.github/workflows/camel-master-cron.yaml
index 7c254c2649..0bf6a4b3d3 100644
--- a/.github/workflows/camel-master-cron.yaml
+++ b/.github/workflows/camel-master-cron.yaml
@@ -70,20 +70,9 @@ jobs:
git clone --depth 1 --branch main https://github.com/apache/camel.git
cd camel
echo "Current Camel commit:" $(git rev-parse HEAD)
- - name: Compute third-party cache key
- id: cache-key
- run: |
- cd ../camel/parent
- JIRA_VER=$(../mvnw help:evaluate
-Dexpression=jira-rest-client-api-version -q -DforceStdout -N)
- cd -
- CXF_VER=$(./mvnw help:evaluate -Dexpression=quarkiverse-cxf.version
-q -DforceStdout -N)
- HASH=$(printf "${JIRA_VER}\n${CXF_VER}\n" | sha256sum | cut -c1-16)
- echo "key=third-party-maven-${HASH}" >> $GITHUB_OUTPUT
- name: Setup Maven Cache
id: maven-cache
uses: ./.github/actions/setup-maven-cache
- with:
- cache-key: ${{ steps.cache-key.outputs.key }}
- name: Build Camel
run: |
cd ../camel
diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml
index 5fca16574b..49caa815e3 100644
--- a/.github/workflows/ci-build.yaml
+++ b/.github/workflows/ci-build.yaml
@@ -213,24 +213,9 @@ jobs:
with:
ref: ${{ env.CHECKOUT_REF }}
fetch-depth: 0
- - name: Compute third-party cache key
- id: cache-key
- run: |
- if [[ "${{ github.ref }}" == "refs/heads/camel-main" || "${{
github.base_ref }}" == "camel-main" ]]; then
- cd ../camel/parent
- JIRA_VER=$(../mvnw help:evaluate
-Dexpression=jira-rest-client-api-version -q -DforceStdout -N)
- cd -
- else
- JIRA_VER=$(./mvnw help:evaluate
-Dexpression=jira-rest-client.version -q -DforceStdout -N)
- fi
- CXF_VER=$(./mvnw help:evaluate -Dexpression=quarkiverse-cxf.version
-q -DforceStdout -N)
- HASH=$(printf "${JIRA_VER}\n${CXF_VER}\n" | sha256sum | cut -c1-16)
- echo "key=third-party-maven-${HASH}" >> $GITHUB_OUTPUT
- name: Setup Maven Cache
id: maven-cache
uses: ./.github/actions/setup-maven-cache
- with:
- cache-key: ${{ steps.cache-key.outputs.key }}
- name: Build Camel
if: github.ref == 'refs/heads/camel-main' || github.base_ref ==
'camel-main'
run: |
diff --git a/.github/workflows/pr-validate.yml
b/.github/workflows/pr-validate.yml
index b7b3982b21..7632d5bf7d 100644
--- a/.github/workflows/pr-validate.yml
+++ b/.github/workflows/pr-validate.yml
@@ -90,10 +90,6 @@ jobs:
- name: Setup Maven Cache
id: maven-cache
uses: ./.github/actions/setup-maven-cache
- with:
- maven-properties: |
- jira-rest-client.version
- quarkiverse-cxf.version
- name: mvn validate
run: |
./mvnw ${CQ_MAVEN_ARGS} ${BRANCH_OPTIONS} -fae \