mirror of https://github.com/labapart/gattlib
99 lines
3.1 KiB
YAML
99 lines
3.1 KiB
YAML
language: c
|
|
compiler:
|
|
- gcc
|
|
#Disable Clang for now until we support ARM cross-toolchain - clang
|
|
|
|
dist: xenial
|
|
|
|
addons:
|
|
apt:
|
|
packages:
|
|
- gcc-arm-linux-gnueabihf
|
|
- g++-arm-linux-gnueabihf
|
|
- gcc-aarch64-linux-gnu
|
|
- g++-aarch64-linux-gnu
|
|
- libbluetooth-dev
|
|
- rpm
|
|
- python3-pip
|
|
- python3-setuptools
|
|
|
|
install:
|
|
- pip3 install --upgrade cross-sysroot
|
|
|
|
script:
|
|
# Build default Gattlib - Debug
|
|
- mkdir build-debug && pushd build-debug
|
|
- cmake -DCMAKE_BUILD_TYPE=Debug .. && make
|
|
- popd
|
|
|
|
# Build and Package default Gattlib - Release
|
|
- mkdir build-release && pushd build-release
|
|
- cmake -DCMAKE_BUILD_TYPE=Release .. && make && cpack ..
|
|
- popd
|
|
|
|
# Build Gattlib with DBus support - Debug
|
|
- mkdir build-dbus-debug && pushd build-dbus-debug
|
|
- cmake -DGATTLIB_FORCE_DBUS=TRUE -DCMAKE_BUILD_TYPE=Debug .. && make
|
|
- popd
|
|
|
|
# Build and Package Gattlib with DBus support - Release
|
|
- mkdir build-dbus-release && pushd build-dbus-release
|
|
- cmake -DGATTLIB_FORCE_DBUS=TRUE -DCMAKE_BUILD_TYPE=Release .. && make && cpack ..
|
|
- popd
|
|
|
|
#
|
|
# Setup build for ARM 32-bit
|
|
#
|
|
- cross-sysroot --distribution debian --distribution-version stable --architecture armhf --build-root $PWD/debian-stable-arm requirements.dep
|
|
|
|
# Set environment variables
|
|
- export SYSROOT=$PWD/debian-stable-arm
|
|
- export CROSS_COMPILE=arm-linux-gnueabihf-
|
|
|
|
# Build and Package Gattlib with DBus support - Release - ARM32
|
|
- mkdir build-dbus-release-arm32 && pushd build-dbus-release-arm32
|
|
- cmake -DGATTLIB_FORCE_DBUS=TRUE -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 && cpack ..
|
|
- popd
|
|
|
|
#
|
|
# Setup build for ARM 64-bit
|
|
#
|
|
- cross-sysroot --distribution debian --distribution-version stable --architecture arm64 --build-root $PWD/debian-stable-arm64 requirements.dep
|
|
|
|
# Set environment variables
|
|
- export SYSROOT=$PWD/debian-stable-arm64
|
|
- export CROSS_COMPILE=aarch64-linux-gnu-
|
|
|
|
# Build and Package Gattlib with DBus support - Release - ARM64
|
|
- mkdir build-dbus-release-arm64 && pushd build-dbus-release-arm64
|
|
- cmake -DGATTLIB_FORCE_DBUS=TRUE -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 && cpack ..
|
|
- popd
|
|
|
|
before_deploy:
|
|
# Create directory to store the artifacts we want to deploy
|
|
- mkdir artifacts
|
|
|
|
# Copy packages to artifacts
|
|
- cp build-release/gattlib_*_x86_64.deb artifacts/
|
|
- cp build-release/gattlib_*_x86_64.rpm artifacts/
|
|
- cp build-release/gattlib_*_x86_64.zip artifacts/
|
|
# Copy DBUS packages to artifacts
|
|
- for f in build-dbus-release/gattlib_*; do cp "$f" "`echo $f | sed 's/build-dbus-release\/gattlib_/artifacts\/gattlib_dbus_/'`"; done
|
|
# Copy DBUS ARM packages to artifacts
|
|
- cp build-dbus-release-arm32/gattlib_*_armhf.deb artifacts/
|
|
- cp build-dbus-release-arm32/gattlib_*_armhf.zip artifacts/
|
|
# Copy DBUS ARM64 packages to artifacts
|
|
- cp build-dbus-release-arm64/gattlib_*_arm64.deb artifacts/
|
|
- cp build-dbus-release-arm64/gattlib_*_arm64.zip artifacts/
|
|
|
|
deploy:
|
|
provider: releases
|
|
api-key: ${GITHUB_OAUTH_TOKEN}
|
|
file_glob: true
|
|
file: artifacts/*
|
|
skip_cleanup: true
|
|
overwrite: true
|
|
on:
|
|
tags: true
|
|
|