2020-06-18 14:49:13 +07:00
|
|
|
#!/usr/bin/env bash
|
2019-12-27 18:07:53 +07:00
|
|
|
set -eu
|
|
|
|
|
|
|
|
artifacts=()
|
|
|
|
|
2021-04-15 14:56:32 +07:00
|
|
|
for FILE in \
|
2020-01-20 06:53:55 +07:00
|
|
|
authelia-linux-amd64.tar.gz authelia-linux-amd64.tar.gz.sha256 \
|
|
|
|
authelia-linux-arm32v7.tar.gz authelia-linux-arm32v7.tar.gz.sha256 \
|
2020-04-03 12:13:24 +07:00
|
|
|
authelia-linux-arm64v8.tar.gz authelia-linux-arm64v8.tar.gz.sha256 \
|
2020-04-28 21:07:20 +07:00
|
|
|
authelia-public_html.tar.gz authelia-public_html.tar.gz.sha256;
|
2019-12-27 18:07:53 +07:00
|
|
|
do
|
2021-04-15 14:56:32 +07:00
|
|
|
# Add the version to the artifact name
|
|
|
|
mv $FILE ${FILE/authelia-/authelia-${BUILDKITE_TAG}-}
|
|
|
|
artifacts+=(-a "${FILE/authelia-/authelia-${BUILDKITE_TAG}-}")
|
2019-12-27 18:07:53 +07:00
|
|
|
done
|
|
|
|
|
2021-06-26 08:45:21 +07:00
|
|
|
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
|
|
|
|
|
2020-01-20 06:53:55 +07:00
|
|
|
echo "--- :github: Deploy artifacts for release: ${BUILDKITE_TAG}"
|
2021-03-30 05:17:19 +07:00
|
|
|
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=$?
|
2020-03-01 11:56:04 +07:00
|
|
|
|
2021-06-26 08:45:21 +07:00
|
|
|
if [[ "${EXIT}" == 0 ]];
|
2020-03-01 11:56:04 +07:00
|
|
|
then
|
|
|
|
exit
|
|
|
|
else
|
|
|
|
hub release delete "${BUILDKITE_TAG}" && false
|
|
|
|
fi
|