Skip to content

cmake-multiplatform: fix for others than x86-64 #175

cmake-multiplatform: fix for others than x86-64

cmake-multiplatform: fix for others than x86-64 #175

name: CMake on multiple platforms
on:
workflow_dispatch:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
architecture: [aarch64-linux-gnu, ""]
build_type: [RelWithDebInfo] # MinSizeRel
steps:
- uses: actions/checkout@v4
- name: Install generic dependencies
run: |
sudo apt clean && sudo apt update
sudo apt-get -y install --no-install-recommends \
curl
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build container for ${{ matrix.architecture }}
if: matrix.architecture == 'aarch64-linux-gnu'
run: |
podman build --from=aarch64/ubuntu:24.04 misc/container -t container-aarch64
- name: Run build in container for ${{ matrix.architecture }}
if: matrix.architecture == 'aarch64-linux-gnu'
run: |
podman run -v $PWD/.:/aws-greengrass-lite --replace --name ggl container-aarch64:latest bash -c "cd /aws-greengrass-lite && rm -rf build/ && cmake -DCMAKE_TOOLCHAIN_FILE=/aarch64.cmake -B build -DCMAKE_INSTALL_PREFIX=/opt/aws-greengrass-lite -DGGL_LOG_LEVEL=DEBUG -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER_TARGET=aarch64-linux-gnu -DCMAKE_FIND_DEBUG_MODE=ON"
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Package
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: |
cpack -G DEB
mkdir ${{ github.workspace }}/zipfile/
cp ${{ steps.strings.outputs.build-output-dir }}/*.deb ${{ github.workspace }}/zipfile/
- name: Generate readme / install file
run: |
cat ${{ github.workspace }}/.github/workflows/cmake-multi-platform/readme.template.txt >> ${{ github.workspace }}/zipfile/readme.txt
cp ${{ github.workspace }}/.github/workflows/cmake-multi-platform/install-greengrass-lite.sh ${{ github.workspace }}/zipfile/
- name: Save package
uses: actions/upload-artifact@v4
with:
name: aws-greengrass-lite-ubuntu-${{ matrix.architecture || 'x86-64'}}_${{ matrix.build_type }}
path: |
${{ github.workspace }}/zipfile/*
retention-days: 1