Skip to content

Providing DEB #1831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from
51 changes: 51 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,54 @@ jobs:
allowUpdates: true
updateOnlyUnreleased: true
artifacts: "${{ env.PACKAGE_DIR }}.tar.gz"

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

- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends cmake make g++ libpcap-dev
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step fails because we don't run it as sudo, which made me notice that this runs directly on the GitHub runner VM. Why not run it inside one of our containers like seladb/ubuntu2404? This image should already have these dependencies pre-installed


- name: Build project
run: |
mkdir -p "${{ env.BUILD_DIR }}"
cd "${{ env.BUILD_DIR }}"
cmake ..
make -j$(nproc)
make install DESTDIR=$PWD/install-root
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of installing PcapPlusPlus here, maybe we can build the deb file, install it, and add another step to test that it works?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking into it


- name: Create DEB control file
run: |
cd "${{ env.BUILD_DIR }}/install-root"
mkdir -p DEBIAN
cat <<EOF > DEBIAN/control
Package: pcapplusplus
Version: ${{ github.event.release.tag_name }}
Section: libs
Architecture: amd64
Maintainer: Bhaskar Bhar <bhaskarbhar007@yahoo.com>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add pcapplusplus@gmail.com as a maintainer?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes sir

Description: PcapPlusPlus - C++ library for packet parsing and crafting
EOF

- name: Build DEB package
run: |
cd "${{ env.BUILD_DIR }}"
dpkg-deb --build install-root pcapplusplus_${{ github.event.release.tag_name }}_amd64.deb

- name: Upload DEB to release
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
with:
draft: true
allowUpdates: true
updateOnlyUnreleased: true
artifacts: "${{ env.BUILD_DIR }}/pcapplusplus_${{ github.event.release.tag_name }}_amd64.deb"
Copy link
Collaborator

@Dimi1010 Dimi1010 May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not have an if clause? The rest of the package CI's have the upload steps under if: github.ref_type == 'tag' clause?

Loading