forked from ubuntu/authd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
66 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,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' |