Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,45 @@ jobs:
allowUpdates: true
updateOnlyUnreleased: true
artifacts: "${{ env.PACKAGE_DIR }}.tar.gz"

build-deb:
runs-on: ubuntu-latest
container: seladb/ubuntu2404
permissions:
contents: write
attestations: write
id-token: write
env:
BUILD_DIR: Dist
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set package version
shell: bash
run: |
RAW_VERSION="${{ github.event.release.tag_name }}"
if [ -z "$RAW_VERSION" ]; then RAW_VERSION="${GITHUB_REF_NAME:-0.0.0-dev}"; fi
VERSION="${RAW_VERSION//\//-}"
echo "VERSION=$VERSION" >> $GITHUB_ENV

- name: Configure and build with CMake
run: |
mkdir -p "${{ env.BUILD_DIR }}"
cd "${{ env.BUILD_DIR }}"
cmake -DPCAPPP_PACKAGE=ON -DPCAPPP_INSTALL=ON -DPROJECT_VERSION=${{ env.VERSION }} ..
make -j$(nproc)

- name: Package with CPack (DEB)
run: |
cd "${{ env.BUILD_DIR }}"
cpack -G DEB

- name: Upload DEB to release
if: github.ref_type == 'tag'
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
with:
draft: true
allowUpdates: true
updateOnlyUnreleased: true
artifacts: "${{ env.BUILD_DIR }}/*.deb"
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ if(PCAPPP_PACKAGE)
cmake_host_system_information(RESULT DISTRO_VERSION_ID QUERY DISTRIB_VERSION_ID)
set(_PCAPPP_PACKAGE_README_CUSTOM_PATH "${_PCAPPP_PACKAGE_README_PATH}/README.release.linux")
if("${DISTRO_ID}" STREQUAL "ubuntu")
# set(CPACK_GENERATOR ${CPACK_GENERATOR};DEB)
set(CPACK_GENERATOR ${CPACK_GENERATOR};DEB)
elseif("${DISTRO_ID}" STREQUAL "centos" OR "${DISTRO_ID}" STREQUAL "rhel")
# set(CPACK_GENERATOR ${CPACK_GENERATOR};RPM)
elseif("${DISTRO_ID}" STREQUAL "freebsd")
Expand Down
Loading