Skip to content

Commit

Permalink
use date if quering timestamp failed
Browse files Browse the repository at this point in the history
Signed-off-by: YanxuanLiu <[email protected]>
  • Loading branch information
YanxuanLiu committed Nov 28, 2024
1 parent 0f16726 commit 04c4c28
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/mvn-verify-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ jobs:
set -x
jniVer=$(mvn help:evaluate -q -pl dist -Dexpression=spark-rapids-jni.version -DforceStdout)
privateVer=$(mvn help:evaluate -q -pl dist -Dexpression=spark-rapids-private.version -DforceStdout)
jniTimestamp=$(curl -s -H "Accept: application/json" "https://oss.sonatype.org/service/local/artifact/maven/resolve?r=snapshots&g=com.nvidia&a=spark-rapids-jni&v=${jniVer}&c=&e=jar&wt=json" | jq .data.snapshotTimeStamp)
privateTimestamp=$(curl -s -H "Accept: application/json" "https://oss.sonatype.org/service/local/artifact/maven/resolve?r=snapshots&g=com.nvidia&a=rapids-4-spark-private_2.12&v=${privateVer}&c=&e=jar&wt=json" | jq .data.snapshotTimeStamp)
jniTimestamp=$(curl -s -H "Accept: application/json" \
"https://oss.sonatype.org/service/local/artifact/maven/resolve?r=snapshots&g=com.nvidia&a=spark-rapids-jni&v=${jniVer}&c=&e=jar&wt=json" \
| jq .data.snapshotTimeStamp) || $(date +'%Y-%m-%d')
privateTimestamp=$(curl -s -H "Accept: application/json" \
"https://oss.sonatype.org/service/local/artifact/maven/resolve?r=snapshots&g=com.nvidia&a=rapids-4-spark-private_2.12&v=${privateVer}&c=&e=jar&wt=json" \
| jq .data.snapshotTimeStamp) || $(date +'%Y-%m-%d')
cacheKey="${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.event.pull_request.base.ref }}-${jniTimestamp}-${privateTimestamp}"
echo "dailyCacheKey=$cacheKey" | tee $GITHUB_ENV $GITHUB_OUTPUT
- name: Cache local Maven repository
Expand Down Expand Up @@ -171,8 +175,12 @@ jobs:
set -x
jniVer=$(mvn help:evaluate -q -pl dist -Dexpression=spark-rapids-jni.version -DforceStdout)
privateVer=$(mvn help:evaluate -q -pl dist -Dexpression=spark-rapids-private.version -DforceStdout)
jniTimestamp=$(curl -s -H "Accept: application/json" "https://oss.sonatype.org/service/local/artifact/maven/resolve?r=snapshots&g=com.nvidia&a=spark-rapids-jni&v=${jniVer}&c=&e=jar&wt=json" | jq .data.snapshotTimeStamp)
privateTimestamp=$(curl -s -H "Accept: application/json" "https://oss.sonatype.org/service/local/artifact/maven/resolve?r=snapshots&g=com.nvidia&a=rapids-4-spark-private_2.13&v=${privateVer}&c=&e=jar&wt=json" | jq .data.snapshotTimeStamp)
jniTimestamp=$(curl -s -H "Accept: application/json" \
"https://oss.sonatype.org/service/local/artifact/maven/resolve?r=snapshots&g=com.nvidia&a=spark-rapids-jni&v=${jniVer}&c=&e=jar&wt=json" \
| jq .data.snapshotTimeStamp) || $(date +'%Y-%m-%d')
privateTimestamp=$(curl -s -H "Accept: application/json" \
"https://oss.sonatype.org/service/local/artifact/maven/resolve?r=snapshots&g=com.nvidia&a=rapids-4-spark-private_2.13&v=${privateVer}&c=&e=jar&wt=json" \
| jq .data.snapshotTimeStamp) || $(date +'%Y-%m-%d')
cacheKey="${{ runner.os }}-maven-scala213-${{ hashFiles('**/pom.xml') }}-${{ github.event.pull_request.base.ref }}-${jniTimestamp}-${privateTimestamp}"
echo "scala213dailyCacheKey=$cacheKey" | tee $GITHUB_ENV $GITHUB_OUTPUT
- name: Cache local Maven repository
Expand Down

0 comments on commit 04c4c28

Please sign in to comment.