Build (Linux Cross) #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build (Linux Cross) | |
on: | |
workflow_call: | |
inputs: | |
imgui_commit: | |
description: 'SHA-1 hash to checkout' | |
default: '' | |
required: false | |
type: string | |
fetch_depth: | |
description: 'Number of commits to fetch. 0 indicates all history for all branches and tags.' | |
default: '1' | |
required: false | |
type: string | |
workflow_dispatch: | |
inputs: | |
imgui_commit: | |
description: 'SHA-1 hash to checkout' | |
default: '' | |
required: false | |
fetch_depth: | |
description: 'Number of commits to fetch. 0 indicates all history for all branches and tags.' | |
default: '1' | |
required: false | |
jobs: | |
build: | |
permissions: | |
contents: write | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
steps: | |
- name: Update sources.list for cross compilation tools | |
continue-on-error: true | |
run: | | |
# - https://askubuntu.com/a/1323570 | |
# Apt can't find packages on Ubuntu 20.04 arm64 (Raspberry Pi 4) | |
# - https://askubuntu.com/questions/1255707/apt-cant-find-packages-on-ubuntu-20-04-arm64-raspberry-pi-4 | |
sudo dpkg --add-architecture arm64 | |
sudo touch /etc/apt/sources.list.d/arm-cross-compile-sources.list | |
sudo bash -c 'echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy main multiverse universe" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list' | |
# sudo bash -c 'echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-security main multiverse universe" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list' | |
sudo bash -c 'echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-backports main multiverse universe" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list' | |
sudo bash -c 'echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates main multiverse universe" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list' | |
sudo apt update | |
# # Ref.: How to use apt-get to download multi-arch library? | |
# # https://askubuntu.com/a/1323570 | |
# sudo dpkg --add-architecture arm64 | |
# sudo touch /etc/apt/sources.list.d/arm-cross-compile-sources.list | |
# sudo bash -c 'echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy main restricted" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list' | |
# sudo bash -c 'echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates main restricted" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list' | |
# sudo bash -c 'echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy universe" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list' | |
# sudo bash -c 'echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates universe" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list' | |
# sudo bash -c 'echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy multiverse" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list' | |
# sudo bash -c 'echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates multiverse" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list' | |
# sudo bash -c 'echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse" >> /etc/apt/sources.list.d/arm-cross-compile-sources.list' | |
# sudo apt update | |
- name: Setup OpenGL and cross compilation tools | |
run: | | |
sudo apt -y install libc6-arm64-cross libc6-dev-arm64-cross libstdc++-12-dev-arm64-cross g++-12-aarch64-linux-gnu g++-aarch64-linux-gnu | |
# sudo apt -y install libc6-dev-arm64-cross libstdc++-12-dev-arm64-cross g++-aarch64-linux-gnu | |
# sudo apt -y install gcc-multilib g++-multilib libc6-dev-arm64-cross libstdc++-10-dev-arm64-cross g++-aarch64-linux-gnu | |
# sudo apt -y install libopengl-dev:arm64 libxrandr-dev:arm64 mesa-common-dev:arm64 libxinerama-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: 'update' | |
fetch-depth: ${{ github.event.inputs.fetch_depth }} | |
submodules: recursive | |
- name: Checkout specific ImGui commit | |
if: "${{ github.event.inputs.imgui_commit != ''}}" | |
run: | | |
cd imgui_dll/cimgui/imgui | |
git checkout -f --detach ${{ github.event.inputs.imgui_commit }} | |
cd ../../.. | |
- name: Install luajit | |
continue-on-error: true | |
run: | | |
sudo apt install luajit | |
luajit -v | |
- name: Generate cimgui code | |
run: | | |
cd imgui_dll/cimgui/generator | |
luajit generator.lua gcc "" | |
cd ../../.. | |
- name: Build imgui so | |
run: | | |
cd imgui_dll | |
bash ./build_imgui_linux_cross.sh | |
cd .. | |
- name: Build imnodes so | |
run: | | |
cd imnodes_dll | |
bash ./build_imnodes_linux_cross.sh | |
cd .. | |
- name: Commit new libraries | |
continue-on-error: true | |
run: | | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}" | |
git add lib/* | |
git commit -a -m "commit by ${GITHUB_ACTOR} via GitHub Actions" | |
git push --force-with-lease -u origin update |