-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add workflow to build debian package as part of build
- Loading branch information
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Build debian packages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "*" | ||
pull_request: | ||
|
||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
DEBCONF_NONINTERACTIVE_SEEN: true | ||
TERM: dumb | ||
|
||
jobs: | ||
build-deb-package: | ||
name: Build ubuntu package | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
AS_USER: runuser -u builder -- | ||
|
||
container: | ||
image: ubuntu:devel | ||
|
||
steps: | ||
- name: Prepare container | ||
run: | | ||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90aptyes | ||
apt update | ||
apt upgrade | ||
apt install git | ||
git config --system --add safe.directory $PWD | ||
- name: Checkout authd code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: | | ||
apt install equivs devscripts lintian | ||
mk-build-deps -ir | ||
- name: Setup build user | ||
run: | | ||
adduser --disabled-password --gecos "" builder | ||
chown builder:builder . -R | ||
- name: Build packages | ||
run: | | ||
export DEBEMAIL="$(git log -1 --format='%ae' HEAD)" | ||
export DEBFULLNAME="$(git log -1 --format='%an' HEAD)" | ||
$AS_USER dch --local "+git$(git rev-parse --short HEAD)" "CI: Autoamtic build" | ||
$AS_USER dpkg-buildpackage -b --jobs=$(getconf _NPROCESSORS_ONLN) | ||
mv -v ../*.deb . | ||
ls -lht *.deb | ||
- name: Archiving built debs | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: debian-packages | ||
path: ./*.*deb | ||
if-no-files-found: error | ||
|
||
- name: Install built debs | ||
run: | | ||
apt install --simulate ./*.deb | ||
- name: Lint generated debs | ||
run: | | ||
$AS_USER lintian --pedantic --fail-on error ./*.deb |