@@ -41,15 +41,35 @@ jobs:
41
41
cd /home/runner/work
42
42
mkdir -p sycl_bundle
43
43
cd sycl_bundle
44
- export LATEST_LLVM_TAG=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/intel/llvm.git | grep sycl-nightly | tail --lines=1)
45
- export LATEST_LLVM_TAG_SHA=$(echo ${LATEST_LLVM_TAG} | awk '{print $1}')
46
- export NIGHTLY_TAG=$(python3 -c "import sys, urllib.parse as ul; print (ul.quote_plus(sys.argv[1]))" \
47
- $(echo ${LATEST_LLVM_TAG} | awk '{gsub(/^refs\/tags\//, "", $2)} {print $2}'))
48
- if [[ -f bundle_id.txt && ( "$(cat bundle_id.txt)" == "${LATEST_LLVM_TAG_SHA}" ) ]]; then
49
- echo "Using cached download of ${LATEST_LLVM_TAG}"
44
+ # get list of shas and tags from remote, filter sycl-nightly tags and reverse order
45
+ export LLVM_TAGS=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/intel/llvm.git | \
46
+ grep sycl-nightly | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }')
47
+ # initialize
48
+ unset DEPLOY_NIGHTLY_TAG
49
+ unset DEPLOY_NIGHTLY_TAG_SHA
50
+
51
+ # go through tags and find the most recent one where nighly build binary is available
52
+ while IFS= read -r NEXT_LLVM_TAG; do
53
+ export NEXT_LLVM_TAG_SHA=$(echo ${NEXT_LLVM_TAG} | awk '{print $1}')
54
+ export NEXT_NIGHTLY_TAG=$(python3 -c "import sys, urllib.parse as ul; print (ul.quote_plus(sys.argv[1]))" \
55
+ $(echo ${NEXT_LLVM_TAG} | awk '{gsub(/^refs\/tags\//, "", $2)} {print $2}'))
56
+ if [[ `wget -S --spider ${DOWNLOAD_URL_PREFIX}/${NEXT_NIGHTLY_TAG}/dpcpp-compiler.tar.gz 2>&1 | grep 'HTTP/1.1 200 OK'` ]];
57
+ then
58
+ export DEPLOY_NIGHTLY_TAG=${NEXT_NIGHTLY_TAG}
59
+ export DEPLOY_LLVM_TAG_SHA=${NEXT_LLVM_TAG_SHA}
60
+ break
61
+ fi
62
+ done <<< "${LLVM_TAGS}"
63
+
64
+ [[ -n "${DEPLOY_NIGHTLY_TAG}" ]] || exit 1
65
+ [[ -n "${DEPLOY_LLVM_TAG_SHA}" ]] || exit 1
66
+ echo "Using ${m} corresponding to intel/llvm at ${DEPLOY_LLVM_TAG_SHA}"
67
+
68
+ if [[ -f bundle_id.txt && ( "$(cat bundle_id.txt)" == "${DEPLOY_LLVM_TAG_SHA}" ) ]]; then
69
+ echo "Using cached download of ${DEPLOY_LLVM_TAG_SHA}"
50
70
else
51
71
rm -rf dpcpp-compiler.tar.gz
52
- wget ${DOWNLOAD_URL_PREFIX}/${NIGHTLY_TAG }/dpcpp-compiler.tar.gz && echo ${LATEST_LLVM_TAG_SHA } > bundle_id.txt || rm -rf bundle_id.txt
72
+ wget ${DOWNLOAD_URL_PREFIX}/${DEPLOY_NIGHTLY_TAG }/dpcpp-compiler.tar.gz && echo ${DEPLOY_LLVM_TAG_SHA } > bundle_id.txt || rm -rf bundle_id.txt
53
73
[ -f ${OCLCPUEXP_FN} ] || wget ${DOWNLOAD_URL_PREFIX}/${DRIVER_PATH}/${OCLCPUEXP_FN} || rm -rf bundle_id.txt
54
74
[ -f ${FPGAEMU_FN} ] || wget ${DOWNLOAD_URL_PREFIX}/${DRIVER_PATH}/${FPGAEMU_FN} || rm -rf bundle_id.txt
55
75
[ -f ${TBB_FN} ] || wget ${TBB_URL}/${TBB_FN} || rm -rf bundle_id.txt
0 commit comments