Skip to content

Statically link libboost_program_options for tm1637_say util #24

Statically link libboost_program_options for tm1637_say util

Statically link libboost_program_options for tm1637_say util #24

name: Build & Package lib_tm1637_rpi
on:
pull_request:
push:
branches:
- main
- dev
release:
types: ['released', 'prereleased']
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linux-arm-sysroots:
name: Build sysroots for ARM Linux
strategy:
matrix:
arch: [armhf, arm64]
uses: neildavis/rpi-cross-toolchain-workflow/.github/workflows/rpi-arm-sysroots.yml@v1
with:
deb_release: bookworm
arch: ${{ matrix.arch }}
apt_pkgs: "libboost-program-options-dev"
lib_tm1637_rpi_build:
name: Build & package libTM1637 binaries
needs: [linux-arm-sysroots]
runs-on: ubuntu-24.04
strategy:
matrix:
tuple: [armv6-rpi-linux-gnueabihf, aarch64-rpi3-linux-gnu]
include:
- tuple: armv6-rpi-linux-gnueabihf
arch: armhf
- tuple: aarch64-rpi3-linux-gnu
arch: arm64
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: true
- name: Restore sysroot from cache
uses: actions/cache/restore@v4
with:
key: ${{ needs.linux-arm-sysroots.outputs[format('sysroot_cache_key_{0}', matrix.arch)] }}
path: ${{ needs.linux-arm-sysroots.outputs[format('sysroot_path_{0}', matrix.arch)] }}
fail-on-cache-miss: true
- name: Install x-tools
run: wget -qO- "https://github.com/neildavis/rpi-cross-toolchain-workflow/releases/latest/download/x-tools-${{ matrix.tuple }}.tar.gz" | tar xz -C $HOME
- name: Cross build lib_tm1637_rpi
run: |
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=$HOME/x-tools/${{ matrix.tuple }}/cmake/${{ matrix.tuple }}.cmake
cmake --build build -j$(nproc)
- name: Package lib_tm1637_rpi DEB
run: cd build && cpack -G DEB -D CPACK_DEBIAN_PACKAGE_ARCHITECTURE=${{ matrix.arch }}
- name: Upload DEB artifact
uses: actions/upload-artifact@v4
with:
name: lib_tm1637_rpi_${{ matrix.arch }}-${{ github.run_number }}
path: _packages/*.deb
- name: Release DEB artifact
if: ${{ github.event.action == 'released' || github.event.action == 'prereleased' }}
uses: softprops/action-gh-release@v2
with:
files: "_packages/*.deb"