|
17 | 17 | permissions: read-all |
18 | 18 |
|
19 | 19 | 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 | +
|
20 | 32 | download-OpenCL-Clang: # openCL Clang is downloaded from intel/intel-graphics-compiler releases |
| 33 | + needs: [get-release-tag] |
21 | 34 | if: github.repository == 'intel/intel-graphics-compiler' |
22 | 35 | runs-on: ubuntu-latest |
23 | 36 | env: |
|
27 | 40 | outputs: |
28 | 41 | CLANG_CACHE_KEY: ${{ env.CLANG_CACHE_KEY }} |
29 | 42 | 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 |
35 | 43 | - name: set initial cache key |
36 | 44 | 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 }}" |
38 | 46 | echo "CLANG_CACHE_KEY=$LOC_CLANG_CACHE_KEY" >> $GITHUB_ENV |
39 | 47 | echo "ORIGINAL_CLANG_CACHE_KEY=$LOC_CLANG_CACHE_KEY" >> $GITHUB_ENV |
40 | 48 | - name: caching downloaded OpenCL Clang # Downloading a new OpenCL Clang only after the new IGC is released |
|
48 | 56 | run: | |
49 | 57 | if [[ $(ls ./igc-official-release | wc -c) == "0" ]]; then |
50 | 58 | 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 |
52 | 60 | fi |
53 | 61 | - name: creating a folder for downloaded deb files |
54 | 62 | if: ${{ steps.cache-igc-release.outputs.cache-hit != 'true' || env.CLANG_CACHE_VALID != 'true' }} |
|
57 | 65 | if: ${{ steps.cache-igc-release.outputs.cache-hit != 'true' || env.CLANG_CACHE_VALID != 'true' }} |
58 | 66 | working-directory: ./igc-official-release |
59 | 67 | # 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 - |
61 | 69 | - name: checking if downloaded deb files are here |
62 | 70 | run: | |
63 | 71 | ls ./igc-official-release |
@@ -133,11 +141,6 @@ jobs: |
133 | 141 | - uses: actions/checkout@v6 |
134 | 142 |
|
135 | 143 | #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 |
141 | 144 | - name: getting OpenCL Clang from cache from the previous job |
142 | 145 | id: cache-igc-release |
143 | 146 | uses: actions/cache@v5 |
|
0 commit comments