Skip to content

Commit 17b5b0c

Browse files
amielczaigcbot
authored andcommitted
Adjust build script
Adjust the build script to include cached pre-release artifacts.
1 parent fdd7b4d commit 17b5b0c

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

.github/workflows/build-IGC.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,20 @@ on:
1717
permissions: read-all
1818

1919
jobs:
20+
get-release-tag:
21+
if: github.repository == 'intel/intel-graphics-compiler'
22+
runs-on: ubuntu-latest
23+
outputs:
24+
tag: ${{ steps.get-latest-IGC-release-tag.outputs.tag }}
25+
steps:
26+
- name: get latest IGC release tag
27+
id: get-latest-IGC-release-tag
28+
run: |
29+
TAG=$(gh api repos/intel/intel-graphics-compiler/releases --jq '[.[] | select(.draft | not)][0].tag_name')
30+
echo "tag=$TAG" >> $GITHUB_OUTPUT
31+
2032
download-OpenCL-Clang: # openCL Clang is downloaded from intel/intel-graphics-compiler releases
33+
needs: [get-release-tag]
2134
if: github.repository == 'intel/intel-graphics-compiler'
2235
runs-on: ubuntu-latest
2336
env:
@@ -27,14 +40,9 @@ jobs:
2740
outputs:
2841
CLANG_CACHE_KEY: ${{ env.CLANG_CACHE_KEY }}
2942
steps:
30-
- name: get latest IGC release tag
31-
id: get-latest-IGC-release-tag
32-
run: |
33-
TAG=$(gh api repos/intel/intel-graphics-compiler/releases/latest --jq .tag_name)
34-
echo "tag=$TAG" >> $GITHUB_OUTPUT
3543
- name: set initial cache key
3644
run: |
37-
LOC_CLANG_CACHE_KEY="${{ steps.get-latest-IGC-release-tag.outputs.tag }}"
45+
LOC_CLANG_CACHE_KEY="${{ needs.get-release-tag.outputs.tag }}"
3846
echo "CLANG_CACHE_KEY=$LOC_CLANG_CACHE_KEY" >> $GITHUB_ENV
3947
echo "ORIGINAL_CLANG_CACHE_KEY=$LOC_CLANG_CACHE_KEY" >> $GITHUB_ENV
4048
- name: caching downloaded OpenCL Clang # Downloading a new OpenCL Clang only after the new IGC is released
@@ -48,7 +56,7 @@ jobs:
4856
run: |
4957
if [[ $(ls ./igc-official-release | wc -c) == "0" ]]; then
5058
echo "CLANG_CACHE_VALID=false" >> $GITHUB_ENV
51-
echo "CLANG_CACHE_KEY=${{ steps.get-latest-IGC-release-tag.outputs.tag }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}" >> $GITHUB_ENV
59+
echo "CLANG_CACHE_KEY=${{ needs.get-release-tag.outputs.tag }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}" >> $GITHUB_ENV
5260
fi
5361
- name: creating a folder for downloaded deb files
5462
if: ${{ steps.cache-igc-release.outputs.cache-hit != 'true' || env.CLANG_CACHE_VALID != 'true' }}
@@ -57,7 +65,7 @@ jobs:
5765
if: ${{ steps.cache-igc-release.outputs.cache-hit != 'true' || env.CLANG_CACHE_VALID != 'true' }}
5866
working-directory: ./igc-official-release
5967
# To install openCL clang from Deb package, IGC must also be installed. Therefore, the last IGC release is also downloaded.
60-
run: curl -s https://api.github.com/repos/intel/intel-graphics-compiler/releases/latest | grep browser_download_url | egrep 'opencl-|core-' | cut -d '"' -f 4 | wget -qi -
68+
run: gh api repos/intel/intel-graphics-compiler/releases/tags/${{ needs.get-release-tag.outputs.tag }} --jq '.assets[].browser_download_url' | egrep 'opencl-|core-' | wget -qi -
6169
- name: checking if downloaded deb files are here
6270
run: |
6371
ls ./igc-official-release
@@ -133,11 +141,6 @@ jobs:
133141
- uses: actions/checkout@v6
134142

135143
#Get OpenCL Clang
136-
- name: get latest IGC release tag
137-
id: get-latest-IGC-release-tag
138-
run: |
139-
TAG="$(gh api repos/intel/intel-graphics-compiler/releases/latest --jq .tag_name)"
140-
echo "tag=$TAG" >> $GITHUB_OUTPUT
141144
- name: getting OpenCL Clang from cache from the previous job
142145
id: cache-igc-release
143146
uses: actions/cache@v5

0 commit comments

Comments
 (0)