Skip to content

Commit

Permalink
Make sure you run ldconfig, add testing before deploying packages
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewQuijano committed Dec 14, 2024
1 parent c199ea1 commit 482a02e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 28 deletions.
51 changes: 24 additions & 27 deletions .github/workflows/publish_deb.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Publish deb package

on:
workflow_dispatch:
push:
branches:
master
Expand All @@ -20,42 +21,37 @@ jobs:
release_branch: master
use_api: true

build_deb_2004:
build_and_publish:
needs: create_release
runs-on: ubuntu-20.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]

steps:
- name: Install git
run: sudo apt-get -qq update -y && sudo apt-get -qq install cmake ninja-build rapidjson-dev -y
- name: Install dependencies
run: |
sudo apt-get -qq update -y
sudo apt-get -qq install cmake ninja-build rapidjson-dev libgtest-dev -y
- name: Check out
uses: actions/checkout@v4

- name: Build package
- name: Build with testing enabled and run tests
working-directory: .
run: mkdir build && cd build && cmake -GNinja .. && ninja && ninja package

- name: Upload debian package to release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.create_release.outputs.v-version }}
files: |
build/*.deb
build_deb_2204:
needs: create_release
runs-on: ubuntu-22.04

steps:
- 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
run: |
mkdir build
cd build
cmake -GNinja -DENABLE_TESTING=ON ..
ninja
ninja test
- name: Remove build directory after tests
if: success() # Only run if tests pass
run: rm -rf build

- name: Build package
if: success() # Only run if tests pass
working-directory: .
run: |
mkdir build
Expand All @@ -65,10 +61,11 @@ jobs:
ninja package
- name: Upload debian package to release
if: success() # Only run if package build succeeds
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.create_release.outputs.v-version }}
files: |
build/*.deb
build/*.deb
4 changes: 3 additions & 1 deletion CPackConfig.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ if(UBUNTU_CHECK STREQUAL "Ubuntu")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${UBUNTU_VERSION}")
endif()

include(CPack)
# Include additional control files
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/triggers")

include(CPack)
2 changes: 2 additions & 0 deletions triggers
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Trigger ldconfig after install
activate-noawait ldconfig

0 comments on commit 482a02e

Please sign in to comment.