Skip to content

Build and Package

Build and Package #39

Workflow file for this run

name: Build and Package
on:
release:
types: [created]
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:13-bookworm \
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 \
debhelper
mkdir .build
make release
"
# - name: Upload Debian package
# id: upload_package
# uses: actions/upload-artifact@v2
# with:
# name: homed_exporter_${{ github.event.release.tag_name }}_${{ matrix.arch }}.deb
# path: .build/release/homed_exporter_${{ github.event.release.tag_name }}_${{ matrix.arch }}.deb
- name: Upload release asset
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.release.tag_name }}
files: .build/release/*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}