Skip to content

Commit

Permalink
pkging
Browse files Browse the repository at this point in the history
  • Loading branch information
3v1n0 committed Dec 5, 2023
1 parent 7f4520e commit 5560865
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build-deb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build debian packages

on:
push:

env:
DEBIAN_FRONTEND: noninteractive

jobs:
check:
name: Ubuntu Devel
runs-on: ubuntu-latest

env:
UBUNTU_VERSION: devel
BUILD_CONTAINER: authd-build-container
RUN_CMD: docker exec -t -w /src/authd authd-build-container
AS_USER: runuser -u builder --

steps:
- name: Checkout authd code
uses: actions/checkout@v4

- name: Prepare container
run: |
docker run --name $BUILD_CONTAINER \
--tty --security-opt apparmor:unconfined \
-v $(pwd):/src/authd \
-e DEBIAN_FRONTEND \
-e DEBEMAIL="$(git log -1 --format='%ae' HEAD)" \
-e DEBFULLNAME="$(git log -1 --format='%an' HEAD)" \
-e DEBCONF_NONINTERACTIVE_SEEN=true \
-e TERM=dumb \
-e CONCURRENCY_LEVEL="$(getconf _NPROCESSORS_ONLN)" \
-d ubuntu:$UBUNTU_VERSION sleep infinity
$RUN_CMD sh -c "echo 'APT::Get::Assume-Yes \"true\";' > /etc/apt/apt.conf.d/90aptyes"
- name: Install dependencies
run: |
$RUN_CMD apt update
$RUN_CMD apt upgrade
$RUN_CMD apt install equivs devscripts
$RUN_CMD mk-build-deps -ir
- name: Setup build user
run: |
$RUN_CMD adduser --disabled-password --gecos "" builder
$RUN_CMD chown builder:builder /src -R
- name: Build packages
run: |
$RUN_CMD $AS_USER sh -c 'dch --local "+git$0" "CI: Autoamtic build"' $(git rev-parse --short HEAD)
$RUN_CMD $AS_USER dpkg-buildpackage -b --jobs=$CONCURRENCY_LEVEL
$RUN_CMD sh -c 'mv -v ../*.deb .'
$RUN_CMD sh -c 'ls -lht *.deb'
- name: Archiving built debs
uses: actions/upload-artifact@v3
with:
name: debian packages
path: ./*.deb

- name: Install generated debs
run: |
$RUN_CMD sh -c 'apt install --simulate ./*.deb'

0 comments on commit 5560865

Please sign in to comment.