authelia/.buildkite/steps/debhelper.sh
Amir Zarrinkafsh 93e20a44e9
feat: build and distribute .deb packages (#2114)
* feat: build and distribute .deb packages

Creates .deb packages for distribution via GitHub releases and Buildkite builds for the following architectures:

* amd64
* armhf
* arm64

* fix: pkgver reference in debpackages.sh

* refactor: split deb packaging jobs and quote variables

* fix: pipeline upload for debpackages

* fix: depends_on key for debpackages

* fix: add depends_on: ~ for debpackages step

* fix: pre-artifact hook for debpackages

* fix: add .deb suffix in pre-artifact hook

* fix: variable reference in debhelper.sh

* refactor: silence wget output in debhelper.sh

* refactor: make build concurrency gate only depend_on docker builds

* refactor: make build concurrency gate also depend_on coverage build

* refactor: remove dependencies for build concurrency gate
2021-06-26 11:45:21 +10:00

27 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
GITTAG=$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')
if [[ "${BUILDKITE_TAG}" == "" ]]; then
VERSION="pkgver=${GITTAG}"
else
VERSION="pkgver=${BUILDKITE_TAG//v/}"
fi
wget https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=authelia-bin -qO PKGBUILD && \
sed -i -e '/^pkgname=/c pkgname=authelia' -e "/pkgver=/c $VERSION" -e '10,14d' \
-e 's/source_x86_64.*/source_x86_64=("authelia-linux-amd64.tar.gz")/' \
-e 's/source_aarch64.*/source_aarch64=("authelia-linux-arm64v8.tar.gz")/' \
-e 's/source_armv7h.*/source_armv7h=("authelia-linux-arm32v7.tar.gz")/' \
-e 's/sha256sums_x86_64.*/sha256sums_x86_64=("SKIP")/' \
-e 's/sha256sums_aarch64.*/sha256sums_aarch64=("SKIP")/' \
-e 's/sha256sums_armv7h.*/sha256sums_armv7h=("SKIP")/' PKGBUILD
if [[ "${PACKAGE}" == "amd64" ]]; then
docker run --rm -v $PWD:/build authelia/aurpackager bash -c "cd /build && makedeb"
elif [[ "${PACKAGE}" == "armhf" ]]; then
docker run --rm -v $PWD:/build nightah/debpackager:armhf bash -c "cd /build && makedeb"
else
docker run --rm -v $PWD:/build nightah/debpackager:arm64 bash -c "cd /build && makedeb"
fi