authelia/.buildkite/steps/ghartifacts.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

36 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -eu
artifacts=()
for FILE in \
authelia-linux-amd64.tar.gz authelia-linux-amd64.tar.gz.sha256 \
authelia-linux-arm32v7.tar.gz authelia-linux-arm32v7.tar.gz.sha256 \
authelia-linux-arm64v8.tar.gz authelia-linux-arm64v8.tar.gz.sha256 \
authelia-public_html.tar.gz authelia-public_html.tar.gz.sha256;
do
# Add the version to the artifact name
mv $FILE ${FILE/authelia-/authelia-${BUILDKITE_TAG}-}
artifacts+=(-a "${FILE/authelia-/authelia-${BUILDKITE_TAG}-}")
done
for FILE in \
authelia_amd64.deb authelia_amd64.deb.sha256 \
authelia_arm64.deb authelia_arm64.deb.sha256 \
authelia_armhf.deb authelia_armhf.deb.sha256;
do
# Add the version to the artifact name
mv $FILE ${FILE/authelia_/authelia_${BUILDKITE_TAG}_}
artifacts+=(-a "${FILE/authelia_/authelia_${BUILDKITE_TAG}_}")
done
echo "--- :github: Deploy artifacts for release: ${BUILDKITE_TAG}"
hub release create "${BUILDKITE_TAG}" "${artifacts[@]}" -F <(echo -e "${BUILDKITE_TAG}\n$(conventional-changelog -p angular -o /dev/stdout -r 2 | sed -e '1,3d')\n\n### Docker Container\n* \`docker pull authelia/authelia:${BUILDKITE_TAG//v}\`\n* \`docker pull ghcr.io/authelia/authelia:${BUILDKITE_TAG//v}\`"); EXIT=$?
if [[ "${EXIT}" == 0 ]];
then
exit
else
hub release delete "${BUILDKITE_TAG}" && false
fi