Skip to content

Commit

Permalink
Generate packages
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviermartin committed Mar 26, 2024
1 parent 5d9a36f commit 5a040ac
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ jobs:
- uses: actions/checkout@v4
- run: sudo apt install libbluetooth-dev doxygen
- run: mkdir build && pushd build && cmake -DCMAKE_BUILD_TYPE=Release -DGATTLIB_BUILD_DOCS=ON .. && make
- run: pushd build && cpack ..
if: startsWith(github.ref, 'refs/tags/')
env:
PACKAGE_VERSION: '${{github.ref_name}}'
- run: ls build/*
- run: ls build/*.{deb,rpm,zip}
- name: Archive Distribution packages
uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/')
with:
name: distribution-packages
path: |
build/*.deb
build/*.rpm
build/*.zip
build-release-force-dbus:
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ endif()
# Packaging
#
set(CPACK_PACKAGE_INSTALL_DIRECTORY /usr CACHE STRING "Install directory (default: /usr).")
if (ENV{TRAVIS_TAG} AND (NOT "ENV{TRAVIS_TAG}" STREQUAL "dev"))
message("Package Gattlib for tagged version $ENV{TRAVIS_TAG}")
if (ENV{PACKAGE_VERSION} AND (NOT "ENV{PACKAGE_VERSION}" STREQUAL "dev"))
message("Package Gattlib for tagged version $ENV{PACKAGE_VERSION}")

# Transform 'v0.3' into '0.3' and 'v0.3-rc1' into '0.3-rc1'
string(REGEX REPLACE "v([0-9]+).([0-9]+)(.*)" "\\1.\\2\\3" CPACK_PACKAGE_VERSION $ENV{TRAVIS_TAG})
string(REGEX REPLACE "v([0-9]+).([0-9]+)(.*)" "\\1.\\2\\3" CPACK_PACKAGE_VERSION $ENV{PACKAGE_VERSION})
else()
set(CPACK_PACKAGE_VERSION 0.3-dev)
set(CPACK_PACKAGE_VERSION 0.4-dev)
message("Package Gattlib for development version $ENV{CPACK_PACKAGE_VERSION}")
endif()
set(CPACK_PACKAGE_CONTACT "Olivier Martin <[email protected]>")
Expand Down

0 comments on commit 5a040ac

Please sign in to comment.