Skip to content

Commit

Permalink
Merge pull request #16 from AndrewQuijano/master
Browse files Browse the repository at this point in the history
Dynamically Update Debian Package Version
  • Loading branch information
lacraig2 authored Dec 9, 2024
2 parents 8b1d9f1 + 12dd7f3 commit c199ea1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/publish_deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,20 @@ jobs:
runs-on: ubuntu-22.04

steps:
- name: Install git
- name: Install dependencies
run: sudo apt-get -qq update -y && sudo apt-get -qq install cmake ninja-build rapidjson-dev -y

- name: Check out
uses: actions/checkout@v4

- name: Build package
working-directory: .
run: mkdir build && cd build && cmake -GNinja .. && ninja && ninja package
run: |
mkdir build
cd build
cmake -GNinja .. -DVERSION=${{ needs.create_release.outputs.v-version }}
ninja
ninja package
- name: Upload debian package to release
uses: softprops/action-gh-release@v2
Expand Down
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# Read version number from command line argument
if(DEFINED VERSION)
string(REGEX MATCH "v?([0-9]+)\\.([0-9]+)\\.([0-9]+)" _ ${VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_MATCH_1})
set(CPACK_PACKAGE_VERSION_MINOR ${CMAKE_MATCH_2})
set(CPACK_PACKAGE_VERSION_PATCH ${CMAKE_MATCH_3})
else()
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0")
endif()

# find glib and link to it
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLIB_PKG REQUIRED glib-2.0)
Expand Down
3 changes: 0 additions & 3 deletions CPackConfig.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ set(CPACK_PACKAGE_NAME "libosi")
set(CPACK_PACKAGE_DESCRIPTION "Operating System Introspection Support for PANDA plugins")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Operating System Introspection Support for PANDA plugins")
set(CPACK_PACKAGE_VENDOR "PANDA")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "1")
set(CPACK_PACKAGE_VERSION_PATCH "7")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "[email protected]")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE amd64)

Expand Down

0 comments on commit c199ea1

Please sign in to comment.