Skip to content
Merged
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
101 changes: 40 additions & 61 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# Build and lint this package on trixie (handbook decision 0041, first
# implementation, step 5). The check is "package / build".
# implementation, step 5). The check is "build / trixie".
#
# build: gbp buildpackage in a debian:trixie container with
# trixie-backports enabled, source and binary, the orig tarball rebuilt
# from the pristine-tar branch. lintian then checks the .changes and any
# error or warning fails the job, as packages/build of Keel-Linux/common
# does. Nothing is signed or published; the files are kept as the
# artifact "debs".
# build: gbp buildpackage in a Debian trixie system container, an
# unprivileged LXC container with its own systemd on the self-hosted runner
# keel-lxc-1, through the reusable workflow lxc-trixie.yml of
# Keel-Linux/.github, with trixie-backports enabled; source and binary, the
# orig tarball rebuilt from the pristine-tar branch. lintian then checks the
# .changes and any error or warning fails the job, as packages/build of
# Keel-Linux/common does. Nothing is signed or published; the files are kept
# as the artifact "debs". Keel runs no application containers in CI.
#
# This package has no debian/tests of its own. Its rules are exercised by
# the autopkgtest of Keel-Linux/libnginx-mod-http-coraza, whose CI builds
# keel/trixie of this repository and asserts that CRS blocks SQL
# injection, cross-site scripting and path traversal.
#
# Keel-Linux/.github's reusable build-deb.yml does not fit: it runs on the
# self-hosted keel-lxc runner, not registered yet, and neither uses gbp nor
# lints. This workflow follows Keel-Linux/common's packages.yml instead.
# A pull request from a fork never reaches the self-hosted runner: the job
# runs only for this repository's own branches, so a fork pull request gets
# no build or lint result here.
name: package

on:
Expand All @@ -27,56 +29,33 @@ on:
permissions:
contents: read

env:
DEBIAN_FRONTEND: noninteractive

jobs:
build:
runs-on: ubuntu-latest
container: debian:trixie
timeout-minutes: 30
steps:
- name: Enable trixie-backports and install the tools
run: |
echo 'deb http://deb.debian.org/debian trixie-backports main' \
> /etc/apt/sources.list.d/trixie-backports.list
apt-get update -qq
apt-get install -y -qq --no-install-recommends \
ca-certificates git git-buildpackage pristine-tar \
devscripts equivs lintian
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Track the upstream and pristine-tar branches
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
# As gbp clone does: upstream's .gitattributes must not change
# what is exported, or the tree no longer matches the orig tarball.
gbp setup-gitattributes
for branch in upstream/latest pristine-tar; do
git branch -f "$branch" "origin/$branch"
done
- name: Install the build dependencies
run: |
cd "$RUNNER_TEMP"
mk-build-deps --install --remove \
--tool 'apt-get -y -qq --no-install-recommends' \
"$GITHUB_WORKSPACE/debian/control"
- name: Build
run: |
gbp buildpackage --git-ignore-branch \
--git-export-dir="$RUNNER_TEMP/build-area" \
--git-builder='dpkg-buildpackage -us -uc'
mkdir dist
cp "$RUNNER_TEMP"/build-area/*.deb "$RUNNER_TEMP"/build-area/*.dsc \
"$RUNNER_TEMP"/build-area/*.tar.* "$RUNNER_TEMP"/build-area/*.buildinfo \
"$RUNNER_TEMP"/build-area/*.changes dist/
- name: Lint
run: |
lintian --fail-on error,warning --info --display-info \
dist/*.changes
- uses: actions/upload-artifact@v4
with:
name: debs
path: dist/
if-no-files-found: error
uses: keel-linux/.github/.github/workflows/lxc-trixie.yml@main
with:
backports: true
fetch-depth: 0
timeout: 30
artifact-dir: dist
artifact-name: debs
run: |
apt-get update -qq
apt-get install -y -qq --no-install-recommends \
ca-certificates git git-buildpackage pristine-tar \
devscripts equivs lintian
# As gbp clone does: upstream's .gitattributes must not change what
# is exported, or the tree no longer matches the orig tarball.
gbp setup-gitattributes
for branch in upstream/latest pristine-tar; do
git branch -f "$branch" "origin/$branch"
done
(cd /tmp && mk-build-deps --install --remove \
--tool 'apt-get -y -qq --no-install-recommends' /src/debian/control)
gbp buildpackage --git-ignore-branch \
--git-export-dir=/tmp/build-area \
--git-builder='dpkg-buildpackage -us -uc'
lintian --fail-on error,warning --info --display-info \
/tmp/build-area/*.changes
mkdir dist
cp /tmp/build-area/*.deb /tmp/build-area/*.dsc /tmp/build-area/*.tar.* \
/tmp/build-area/*.buildinfo /tmp/build-area/*.changes dist/
Loading