@@ -11,19 +11,15 @@ inputs:
1111 description : ' Cache Qt toolchain artifacts'
1212 required : false
1313 default : ${{ runner.os == 'Windows' }}
14- cmake-env :
15- description : ' Add cmake environment variables'
16- required : false
17- default : true
14+
15+ outputs :
16+ path :
17+ description : ' Qt toolchain installation path'
18+ value : ${{ steps.resolve.outputs.toolchain-path }}
1819
1920runs :
2021 using : " composite"
2122 steps :
22- - name : Set destination path
23- id : set-dest
24- shell : bash
25- run : echo "path=${GITHUB_WORKSPACE}/3rdparty" >> $GITHUB_OUTPUT
26-
2723 - name : Resolve artifact task
2824 id : resolve
2925 shell : bash
@@ -45,41 +41,34 @@ runs:
4541 # contents. Lucky for us, tar is a streamable format so this kinda works
4642 # even though the archive is truncated.
4743 curl -sSL -r0-4096 "https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/${TASKID}/artifacts/${NAME}" -o qt-toolchain-head.tar.xz
48- echo "toolchain-path=$(xzcat qt-toolchain-head.tar.xz 2>/dev/null | tar t 2>/dev/null | head -1 | grep -o '^[^/]*')" >> $GITHUB_OUTPUT
44+ TARBALL_PATH=$((xzcat qt-toolchain-head.tar.xz | tar t | head -1 | grep -o '^[^/]*') 2>/dev/null || true)
45+ echo "toolchain-path=${GITHUB_WORKSPACE}/3rdparty/${TARBALL_PATH}" >> $GITHUB_OUTPUT
4946
5047 - name : Cache Qt toolchain
5148 uses : actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
5249 id : qt-toolchain-cache
5350 if : ${{ inputs.cache == 'true' }}
5451 with :
55- path : ${{ steps.set-dest.outputs.path }}/${{ steps. resolve.outputs.toolchain-path }}
52+ path : ${{ steps.resolve.outputs.toolchain-path }}
5653 key : qt-toolchain-${{ steps.resolve.outputs.taskid }}
5754 enableCrossOsArchive : true
5855
5956 - name : Install Qt toolchain
6057 if : ${{ inputs.cache != 'true' || steps.qt-toolchain-cache.outputs.cache-hit != 'true' }}
6158 id : qt-toolchain-install
62- working-directory : ${{ steps.set-dest.outputs.path }}
59+ working-directory : ${{ runner.temp }}
6360 shell : bash
6461 env :
6562 QT6_TOOLCHAIN_URL : https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/${{ steps.resolve.outputs.taskid }}/artifacts/${{ steps.resolve.outputs.filename }}
6663 run : |
6764 FILENAME=$(basename "${QT6_TOOLCHAIN_URL}")
6865 curl -sSL "${QT6_TOOLCHAIN_URL}" -o ${FILENAME}
69- tar -xf ${FILENAME}
70-
71- - name : Get CMake prefix path
72- if : ${{ inputs.cmake-env == 'true' }}
73- id : get-cmake-path
74- working-directory : ${{ steps.set-dest.outputs.path }}/${{ steps.resolve.outputs.toolchain-path }}
75- shell : bash
76- run : |
77- echo "CMAKE_PREFIX_PATH=$(pwd)/lib/cmake" >> $GITHUB_ENV
66+ tar -C ${GITHUB_WORKSPACE}/3rdparty/ -xf ${FILENAME}
7867
7968 - name : Save Qt toolchain
8069 uses : actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
8170 if : ${{ inputs.cache == 'true' && github.event_name == 'push' && steps.qt-toolchain-cache.outputs.cache-hit != 'true'}}
8271 with :
83- path : ${{ steps.set-dest.outputs.path }}/${{ steps. resolve.outputs.toolchain-path }}
72+ path : ${{ steps.resolve.outputs.toolchain-path }}
8473 key : qt-toolchain-${{ steps.resolve.outputs.taskid }}
8574 enableCrossOsArchive : true
0 commit comments