diff options
| author | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
| commit | 5a079a2d114f96d4847d1ee305d5b7c16eeec50e (patch) | |
| tree | 8926ab44f168acf787d8e19608857b3af0f82758 /contrib/SDL-3.2.8/.github/actions/setup-loongarch64-toolchain | |
Initial commit
Diffstat (limited to 'contrib/SDL-3.2.8/.github/actions/setup-loongarch64-toolchain')
| -rw-r--r-- | contrib/SDL-3.2.8/.github/actions/setup-loongarch64-toolchain/action.yml | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/.github/actions/setup-loongarch64-toolchain/action.yml b/contrib/SDL-3.2.8/.github/actions/setup-loongarch64-toolchain/action.yml new file mode 100644 index 0000000..e7f9ddc --- /dev/null +++ b/contrib/SDL-3.2.8/.github/actions/setup-loongarch64-toolchain/action.yml | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | name: 'Setup LoongArch64 toolchain' | ||
| 2 | description: 'Download Linux LoongArch64 toolchain and set output variables' | ||
| 3 | inputs: | ||
| 4 | version: | ||
| 5 | description: 'LoongArch64 version' | ||
| 6 | default: '2023.08.08' | ||
| 7 | outputs: | ||
| 8 | prefix: | ||
| 9 | description: "LoongArch toolchain prefix" | ||
| 10 | value: ${{ steps.final.outputs.prefix }} | ||
| 11 | cc: | ||
| 12 | description: "LoongArch C compiler" | ||
| 13 | value: ${{ steps.final.outputs.cc }} | ||
| 14 | cxx: | ||
| 15 | description: "LoongArch C++ compiler" | ||
| 16 | value: ${{ steps.final.outputs.cxx }} | ||
| 17 | runs: | ||
| 18 | using: 'composite' | ||
| 19 | steps: | ||
| 20 | - uses: actions/cache/restore@v4 | ||
| 21 | id: restore-cache | ||
| 22 | with: | ||
| 23 | path: /opt/cross-tools | ||
| 24 | key: loongarch64-${{ inputs.version }} | ||
| 25 | |||
| 26 | - name: 'Download LoongArch64 gcc+glibc toolchain' | ||
| 27 | if: ${{ !steps.restore-cache.outputs.cache-hit }} | ||
| 28 | shell: bash | ||
| 29 | run: | | ||
| 30 | url="https://github.com/loongson/build-tools/releases/download/${{ inputs.version }}/CLFS-loongarch64-8.1-x86_64-cross-tools-gcc-glibc.tar.xz" | ||
| 31 | |||
| 32 | wget "$url" -O /tmp/toolchain.tar.xz | ||
| 33 | |||
| 34 | mkdir -p /opt | ||
| 35 | tar -C /opt -x -f /tmp/toolchain.tar.xz | ||
| 36 | |||
| 37 | - uses: actions/cache/save@v4 | ||
| 38 | if: ${{ !steps.restore-cache.outputs.cache-hit }} | ||
| 39 | with: | ||
| 40 | path: /opt/cross-tools | ||
| 41 | key: loongarch64-${{ inputs.version }} | ||
| 42 | - name: 'Set output vars' | ||
| 43 | id: final | ||
| 44 | shell: bash | ||
| 45 | run: | | ||
| 46 | prefix=/opt/cross-tools | ||
| 47 | echo "prefix=${prefix}" >> $GITHUB_OUTPUT | ||
| 48 | cc="${prefix}/bin/loongarch64-unknown-linux-gnu-gcc" | ||
| 49 | cxx="${prefix}/bin/loongarch64-unknown-linux-gnu-g++" | ||
| 50 | echo "cc=${cc}" >> $GITHUB_OUTPUT | ||
| 51 | echo "cxx=${cxx}" >> $GITHUB_OUTPUT | ||
| 52 | echo "LOONGARCH64_CC=${cc}" >>$GITHUB_ENV | ||
| 53 | echo "LOONGARCH64_CXX=${cxx}" >>$GITHUB_ENV | ||
