Skip to content

actions

actions #28

Workflow file for this run

name: Build and Package
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- amd64
- arm64
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up QEMU for cross-compilation
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and package
run: |
docker run --rm --platform linux/${{ matrix.arch }} \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
gcc:11-bullseye \
bash -c "
apt-get update && apt-get install -y \
cmake \
pkg-config \
build-essential \
libpaho-mqtt-dev \
libpaho-mqttpp-dev \
libboost-all-dev \
libjsoncpp-dev \
dpkg-dev
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
make install DESTDIR=package
cd package && dpkg-deb --build . ../homed_exporter_${{ github.sha }}_${{ matrix.arch }}.deb
"
- name: Upload Debian package
uses: actions/upload-artifact@v2
with:
name: homed_exporter_${{ github.sha }}_${{ matrix.arch }}.deb
path: homed_exporter_${{ github.sha }}_${{ matrix.arch }}.deb