deploy #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: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 && cd build | |
cmake -DCMAKE_BUILD_TYPE=Release .. | |
make | |
cpack -G DEB | |
" | |
- name: Upload Debian package | |
uses: actions/upload-artifact@v2 | |
with: | |
name: homed_exporter_${{ github.sha }}_${{ matrix.arch }}.deb | |
path: build/*.deb |