Skip to content

Commit

Permalink
Merge pull request #60 from ihsrobotics/debian
Browse files Browse the repository at this point in the history
Debian
  • Loading branch information
chrehall68 authored Apr 22, 2023
2 parents 17b3eae + eefc203 commit 7355911
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,19 @@ jobs:
# Configure ihsboost CMake in 'build' subdirectory.
run:
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-Dwith_documentation=OFF -Dpython_version=3.10 -Dbuild_tests=ON \
-Dwith_documentation=OFF -Dpython_version=3.10 -Dbuild_tests=ON -Dbuild_debian=ON \
-G "Ninja"

- name: Build
# Build your program with the given configuration
id: build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Package Debian
run: cd ${{github.workspace}}/build && cpack && cd ${{github.workspace}}

- name: install
run: sudo cmake --install ${{github.workspace}}/build && sudo ldconfig
run: sudo dpkg --install ${{github.workspace}}/build/ihs_boost-*.deb && sudo ldconfig

- name: update-build-status
uses: myrotvorets/[email protected]
Expand All @@ -88,11 +91,11 @@ jobs:
context: test-status

# ========== Exit ==========
- name: Upload Artifacts
- name: Upload Debian Artifacts
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: ${{github.workspace}}/build
name: x86_64-linux deb package
path: ${{github.workspace}}/build/ihs_boost-*.deb

# ========== Failure Section ==========
# if build fails, set it to failed
Expand Down
18 changes: 17 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
cmake_minimum_required(VERSION 3.0)
project(ihs_boost VERSION 1.8.1)
project(ihs_boost VERSION 1.8.2)

# options
option(build_tests "build_tests" OFF)
option(with_documentation "with_documentation" OFF)
option(build_debian "build_debian" OFF)

# add modules
add_subdirectory(modules)
Expand All @@ -25,4 +26,19 @@ if (${with_documentation})

# doxygen it
doxygen_add_docs(doxygen ${DOXYGEN_SOURCES} ALL)
endif()

# debian package
if(${build_debian})
# generate debian package
set(CPACK_GENERATOR "DEB")

# set maintainer
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Eliot")

# install on target machine to the provided install path
set(CPACK_PACKAGE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})

# include CPack to use these variables
include(CPack)
endif()

0 comments on commit 7355911

Please sign in to comment.