monocoque/.github/workflows/ci.yaml

61 lines
1.8 KiB
YAML

name: Make Packages
on:
push:
branches: [ "master" ]
tags: [ "*" ]
pull_request:
branches: [ "master" ]
jobs:
example_matrix:
strategy:
matrix:
os: [ubuntu-22.04, debian-latest]
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Update apt
run: sudo apt update
- name: Install Dependencies
run: sudo apt install -y libuv1-dev libargtable2-dev libserialport-dev libconfig-dev libhidapi-dev liblua5.4-dev libxdg-basedir-dev libxml2-dev libpulse-dev
- name: Set build dir
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
github_sha_hash=${{ github.sha }}
echo "github-sha-short=${github_sha_hash:0:7}" >> $GITHUB_OUTPUT
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_C_COMPILER=gcc
-DCMAKE_BUILD_TYPE=Release
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release
- name: Copy script files around to stop .github from being added to the package then build the package
run: |
mkdir PKG_SOURCE
mkdir -p PKG_SOURCE/DEBIAN
mkdir -p PKG_SOURCE/usr/bin/
cp ./tools/distro/debian/dpkg/control ./PKG_SOURCE/DEBIAN/control
cp ./build/monocoque ./PKG_SOURCE/usr/bin/monocoque
dpkg-deb --build PKG_SOURCE monocoque-${{ runner.name }}.deb
- name: Release the Package
uses: softprops/action-gh-release@v1
with:
files: monocoque-${{ runner.name }}.deb