GHA: Action that downloads & caches Linux toolchain

TuxFamily is often down lately, maybe caching could help.
This commit is contained in:
Serhii Snitsaruk 2024-05-25 10:16:40 +02:00
parent 04300e5222
commit ca6d214345
No known key found for this signature in database
GPG Key ID: A965EF8799FFEC2D
4 changed files with 74 additions and 49 deletions

View File

@ -0,0 +1,41 @@
name: Setup Linux toolchain
inputs:
arch:
required: true
runs:
using: "composite"
steps:
- name: Set TOOLCHAIN_URL (x86_64)
if: inputs.arch == 'x86_64'
shell: bash
run: |
echo "TOOLCHAIN_URL=https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2" >> "$GITHUB_ENV"
- name: Set TOOLCHAIN_URL (x86_32)
if: inputs.arch == 'x86_32'
shell: bash
run: |
echo "TOOLCHAIN_URL=https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/i686-godot-linux-gnu_sdk-buildroot.tar.bz2" >> "$GITHUB_ENV"
- name: Cache buildroot
id: cache-buildroot
uses: actions/cache@v4
with:
path: buildroot
key: ${{env.TOOLCHAIN_URL}}
- name: Set up buildroot
if: steps.cache-buildroot.outputs.cache-hit != 'true'
shell: bash
run: |
mkdir buildroot
wget ${TOOLCHAIN_URL} -O buildroot/buildroot.tar.bz2
cd buildroot
tar -xjf buildroot.tar.bz2
ls -l
rm buildroot.tar.bz2
cd buildroot
./relocate-sdk.sh
cd ..

View File

@ -109,6 +109,7 @@ jobs:
env:
BIN: liblimboai.${{matrix.opts.platform}}.${{matrix.opts.target}}.${{matrix.opts.arch}}
TOOLCHAIN_URL:
steps:
- name: Clone godot-cpp
@ -133,25 +134,31 @@ jobs:
id: output-name-prefix
run: echo "name-prefix=${NAME_PREFIX}" >> $GITHUB_OUTPUT
- name: Set up Linux buildroot x86_64
if: matrix.opts.platform == 'linux' && matrix.opts.arch == 'x86_64'
run: |
wget https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
tar -xjf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
mv x86_64-godot-linux-gnu_sdk-buildroot buildroot
cd buildroot
./relocate-sdk.sh
cd ..
- name: Setup Linux toolchain
if: matrix.opts.platform == 'linux'
uses: ./limboai/.github/actions/setup-linux-toolchain
with:
arch: ${{matrix.opts.arch}}
- name: Set up Linux buildroot x86_32
if: matrix.opts.platform == 'linux' && matrix.opts.arch == 'x86_32'
run: |
wget https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/i686-godot-linux-gnu_sdk-buildroot.tar.bz2
tar -xjf i686-godot-linux-gnu_sdk-buildroot.tar.bz2
mv i686-godot-linux-gnu_sdk-buildroot buildroot
cd buildroot
./relocate-sdk.sh
cd ..
# - name: Set up Linux buildroot x86_64
# if: matrix.opts.platform == 'linux' && matrix.opts.arch == 'x86_64'
# run: |
# wget https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
# tar -xjf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
# mv x86_64-godot-linux-gnu_sdk-buildroot buildroot
# cd buildroot
# ./relocate-sdk.sh
# cd ..
# - name: Set up Linux buildroot x86_32
# if: matrix.opts.platform == 'linux' && matrix.opts.arch == 'x86_32'
# run: |
# wget https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/i686-godot-linux-gnu_sdk-buildroot.tar.bz2
# tar -xjf i686-godot-linux-gnu_sdk-buildroot.tar.bz2
# mv i686-godot-linux-gnu_sdk-buildroot buildroot
# cd buildroot
# ./relocate-sdk.sh
# cd ..
- name: Set up Python 3.x
if: matrix.opts.platform == 'windows' || matrix.opts.platform == 'macos'

View File

@ -139,27 +139,10 @@ jobs:
# Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
- uses: ./modules/limboai/.github/actions/init-version
# About sed see: https://github.com/godotengine/buildroot/issues/6
- name: Set up buildroot x86_64
if: matrix.opts.arch == 'x86_64'
run: |
wget https://download.tuxfamily.org/godotengine/toolchains/linux/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
tar -xjf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
mv x86_64-godot-linux-gnu_sdk-buildroot buildroot
cd buildroot
sed -i x86_64-godot-linux-gnu/sysroot/usr/lib/pkgconfig/dbus-1.pc -e "s@/lib@/lib64@g"
./relocate-sdk.sh
cd ..
- name: Set up buildroot x86_32
if: matrix.opts.arch == 'x86_32'
run: |
wget https://download.tuxfamily.org/godotengine/toolchains/linux/i686-godot-linux-gnu_sdk-buildroot.tar.bz2
tar -xjf i686-godot-linux-gnu_sdk-buildroot.tar.bz2
mv i686-godot-linux-gnu_sdk-buildroot buildroot
cd buildroot
./relocate-sdk.sh
cd ..
- name: Set up Linux toolchain
uses: ./modules/limboai/.github/actions/setup-linux-toolchain
with:
arch: ${{matrix.opts.arch}}
- name: Set up scons cache
uses: actions/cache@v4

View File

@ -52,16 +52,10 @@ jobs:
with:
path: modules/limboai
# About sed see: https://github.com/godotengine/buildroot/issues/6
- name: Set up buildroot x86_64
run: |
wget https://download.tuxfamily.org/godotengine/toolchains/linux/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
tar -xjf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
mv x86_64-godot-linux-gnu_sdk-buildroot buildroot
cd buildroot
sed -i x86_64-godot-linux-gnu/sysroot/usr/lib/pkgconfig/dbus-1.pc -e "s@/lib@/lib64@g"
./relocate-sdk.sh
cd ..
- name: Set up Linux toolchain
uses: ./modules/limboai/.github/actions/setup-linux-toolchain
with:
arch: x86_64
- name: Set up scons cache
uses: actions/cache@v4