This is an automated email from the ASF dual-hosted git repository.

the-other-tim-brown pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-xtable.git


The following commit(s) were added to refs/heads/main by this push:
     new 37a69d9b [MINOR] Key the CI build cache on the project version (#1038)
37a69d9b is described below

commit 37a69d9b35689a90697987075a5c37b01a224827
Author: Tim Brown <[email protected]>
AuthorDate: Tue Nov 24 13:13:38 2026 -0500

    [MINOR] Key the CI build cache on the project version (#1038)
    
    The build cache extension does not hash the project version, so after the
    move to 0.6.0-SNAPSHOT it restored xtable-api and xtable-hudi-support-utils
    as 0.5.0-SNAPSHOT jars. Nothing installed the 0.6.0 jars, and Quarkus in
    xtable-service failed to resolve them whenever it was rebuilt.
---
 .github/workflows/mvn-ci-build.yml | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/mvn-ci-build.yml 
b/.github/workflows/mvn-ci-build.yml
index 5c39ce01..1fd53a3a 100644
--- a/.github/workflows/mvn-ci-build.yml
+++ b/.github/workflows/mvn-ci-build.yml
@@ -77,6 +77,14 @@ jobs:
           path: ~/.m2/wrapper/dists
           key: m2-wrapper-${{ runner.os }}-${{ 
hashFiles('**/.mvn/wrapper/maven-wrapper.properties') }}
 
+      # The build cache does not hash the project version, so after a version 
bump
+      # it restores jars named for the old one. Keying on the version avoids 
that.
+      - name: Read project version
+        id: project-version
+        run: |
+          version=$(./mvnw -q -N -ntp help:evaluate 
-Dexpression=project.version -DforceStdout)
+          echo "version=${version}" >> "$GITHUB_OUTPUT"
+
       # A separate cache from the repository above: the build cache extension
       # configured in .mvn/extensions.xml writes to ~/.m2/build-cache, so
       # without this it starts empty every run and never restores a module.
@@ -97,9 +105,9 @@ jobs:
         uses: actions/cache/restore@v6
         with:
           path: ~/.m2/build-cache
-          key: maven-build-cache-${{ runner.os }}-jdk${{ env.JDK_VERSION 
}}-${{ github.sha }}
+          key: maven-build-cache-${{ runner.os }}-jdk${{ env.JDK_VERSION 
}}-${{ steps.project-version.outputs.version }}-${{ github.sha }}
           restore-keys: |
-            maven-build-cache-${{ runner.os }}-jdk${{ env.JDK_VERSION }}-
+            maven-build-cache-${{ runner.os }}-jdk${{ env.JDK_VERSION }}-${{ 
steps.project-version.outputs.version }}-
 
       - name: Build all module with Maven
         run: ./mvnw clean install -ntp -B -T 2
@@ -137,7 +145,7 @@ jobs:
         uses: actions/cache/save@v6
         with:
           path: ~/.m2/build-cache
-          key: maven-build-cache-${{ runner.os }}-jdk${{ env.JDK_VERSION 
}}-${{ github.sha }}
+          key: maven-build-cache-${{ runner.os }}-jdk${{ env.JDK_VERSION 
}}-${{ steps.project-version.outputs.version }}-${{ github.sha }}
 
       # `install` above puts this project's own artifacts into 
~/.m2/repository,
       # including the bundled jars (~1.2 GB, xtable-utilities alone is ~1 GB).

Reply via email to