Skip to content

Build (Linux Cross) #36

Build (Linux Cross)

Build (Linux Cross) #36

Workflow file for this run

name: Build (Linux Cross)
on:
workflow_call:
workflow_dispatch:
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: |
# 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
# sudo apt -y install libc6:arm64 libx11-dev:arm64 libx11-6:arm64
# 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 libglu1-mesa:arm64 libglu1-mesa-dev:arm64
# sudo apt --fix-broken -y install
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'update'
fetch-depth: 1
submodules: recursive
- name: Check before
continue-on-error: true
run: |
# ls -l lib/*
ls -l /lib/aarch64-linux-gnu/*
# ls -l /usr/include/*
ls -l /usr/aarch64-linux-gnu/include/*
ls -l /usr/include/aarch64-linux-gnu/*
- name: Run rebuild script
run: |
cd ${GITHUB_WORKSPACE}/script
bash ./rebuild_libs_linux_cross.sh
cd ${GITHUB_WORKSPACE}
- name: Check after
run: |
ls -l lib/*
- 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