1- name : Build ThunderLibraries on Linux
1+ name : Linux build template
22
33on :
44 workflow_call :
1111 strategy :
1212 matrix :
1313 build_type : [Debug, Release, MinSizeRel]
14+ architecture : [32, 64]
1415
1516# ----- Packages & artifacts -----
16- name : Build type - ${{matrix.build_type}}
17+ name : Build type - ${{matrix.build_type}}${{matrix.architecture == '32' && ' x86' || ''}}
1718 steps :
1819 - name : Install necessary packages
1920 uses : nick-fields/retry@v3
@@ -23,21 +24,23 @@ jobs:
2324 command : |
2425 sudo gem install apt-spy2
2526 sudo apt-spy2 fix --commit --launchpad --country=US
27+ echo "deb http://archive.ubuntu.com/ubuntu/ jammy main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list
28+ echo "deb http://archive.ubuntu.com/ubuntu/ jammy-updates main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list
29+ sudo dpkg --add-architecture i386
2630 sudo apt-get update
27- sudo apt install python3-pip
28- pip install jsonref
29- sudo apt install build-essential cmake ninja-build libusb-1.0-0-dev zlib1g-dev libssl-dev
31+ sudo apt install python3-pip build-essential cmake ninja-build libusb-1.0-0-dev zlib1g-dev zlib1g-dev:i386 libssl-dev gcc-11-multilib g++-11-multilib
32+ sudo pip install jsonref
3033
3134 - name : Download artifacts
3235 uses : actions/download-artifact@v4
3336 with :
34- name : Thunder-${{matrix.build_type}}-artifact
37+ name : Thunder-${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}} -artifact
3538 path : ${{matrix.build_type}}
3639
3740 - name : Unpack files
3841 run : |
39- tar -xvzf ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz
40- rm ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz
42+ tar -xvzf ${{matrix.build_type}}/${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}} .tar.gz
43+ rm ${{matrix.build_type}}/${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}} .tar.gz
4144
4245# ----- Regex & checkout -----
4346 - name : Checkout ThunderLibraries
@@ -59,18 +62,19 @@ jobs:
5962 - name : Build ThunderLibraries
6063 run : |
6164 cmake -G Ninja -S ThunderLibraries -B ${{matrix.build_type}}/build/ThunderLibraries \
62- -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror" \
65+ -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
66+ -DCMAKE_C_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
6367 -DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \
6468 -DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules" \
6569 -DBROADCAST=ON \
6670 ${{steps.libs.outputs.first_match}}
6771 cmake --build ${{matrix.build_type}}/build/ThunderLibraries --target install
6872
6973 - name : Tar files
70- run : tar -czvf ${{matrix.build_type}}.tar.gz ${{matrix.build_type}}
74+ run : tar -czvf ${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}} .tar.gz ${{matrix.build_type}}
7175
7276 - name : Upload
7377 uses : actions/upload-artifact@v4
7478 with :
75- name : ThunderLibraries-${{matrix.build_type}}-artifact
76- path : ${{matrix.build_type}}.tar.gz
79+ name : ThunderLibraries-${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}} -artifact
80+ path : ${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}} .tar.gz
0 commit comments