Skip to content

Refactor dependency resolution out of deployment handler #196

Refactor dependency resolution out of deployment handler

Refactor dependency resolution out of deployment handler #196

name: Build pkgs in containers + qemu
on:
push:
branches:
- main
workflow_dispatch:
pull_request:
jobs:
build:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
architecture: [aarch64-linux-gnu, ""] # arm-linux-gnueabihf
build_type: [RelWithDebInfo, MinSizeRel]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build container for arm-linux-gnueabihf
if: matrix.architecture == 'arm-linux-gnueabihf'
run: |
podman build --from=arm32v7/ubuntu:24.04 --arch=arm32v7 misc/container -t container
- name: Build container for aarch64-linux-gnu
if: matrix.architecture == 'aarch64-linux-gnu'
run: |
podman build --from=docker.io/arm64v8/ubuntu:24.04 --arch=arm64 misc/container -t container
- name: Build container for x86-64
if: matrix.architecture == ''
run: |
podman build misc/container -t container
- name: Run build in container
shell: bash
run: |
podman run -v $PWD/.:/aws-greengrass-lite --replace --name ggl container:latest bash -c "\
cd /aws-greengrass-lite && \
rm -rf build/ && \
cmake -B build -DCMAKE_INSTALL_PREFIX=/opt/aws-greengrass-lite \
-DGGL_LOG_LEVEL=DEBUG \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_FIND_DEBUG_MODE=ON && \
make -C build -j$(nproc) && \
cd build && cpack -G DEB && cd - \
"
- name: Save package
run: |
mkdir ${{ github.workspace }}/zipfile/
cp ${{ github.workspace }}/build/*.deb ${{ github.workspace }}/zipfile/
- name: Generate readme / install file
run: |
cat ${{ github.workspace }}/.github/workflows/build-packages-multi-platform-container-qemu/readme.template.txt >> ${{ github.workspace }}/zipfile/readme.txt
cp ${{ github.workspace }}/.github/workflows/build-packages-multi-platform-container-qemu/install-greengrass-lite.sh ${{ github.workspace }}/zipfile/
sed -i 's|{{ VERSION_LINK }}|${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|g' ${{ github.workspace }}/zipfile/readme.txt
- name: md5sums
run: |
md5sum ${{ 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
- name:
Save x86-64 package without build type - default package to download
if: matrix.build_type == 'MinSizeRel' && matrix.architecture == ''
uses: actions/upload-artifact@v4
with:
name: aws-greengrass-lite-ubuntu-${{ matrix.architecture || 'x86-64'}}
path: |
${{ github.workspace }}/zipfile/*
retention-days: 1
- name:
Save arm64 package without build type - default package to download
if:
matrix.build_type == 'MinSizeRel' && matrix.architecture ==
'aarch64-linux-gnu'
uses: actions/upload-artifact@v4
with:
name: aws-greengrass-lite-ubuntu-arm64
path: |
${{ github.workspace }}/zipfile/*
retention-days: 1