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
58 changes: 58 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,61 @@ 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: 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: 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: Create DEB control file
shell: bash
run: |
cd "${{ env.BUILD_DIR }}/install-root"
mkdir -p DEBIAN
cat <<EOF > DEBIAN/control
Package: pcapplusplus
Version: ${{ env.VERSION }}
Section: libs
Architecture: amd64
Maintainer: PcapPlusPlus Team <pcapplusplus@gmail.com>
Description: PcapPlusPlus - C++ library for packet parsing and crafting
EOF

- name: Build DEB package
shell: bash
run: |
cd "${{ env.BUILD_DIR }}"
dpkg-deb --build install-root "pcapplusplus_${{ env.VERSION }}_amd64.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 }}/pcapplusplus_${{ env.VERSION }}_amd64.deb"
Loading