2020-06-18 14:49:13 +07:00
|
|
|
#!/usr/bin/env bash
|
2019-12-27 18:07:53 +07:00
|
|
|
set -eu
|
|
|
|
|
|
|
|
artifacts=()
|
|
|
|
|
2020-01-05 21:31:33 +07:00
|
|
|
for FILES 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
|
2020-01-05 21:31:33 +07:00
|
|
|
artifacts+=(-a "${FILES}")
|
2019-12-27 18:07:53 +07:00
|
|
|
done
|
|
|
|
|
2020-01-20 06:53:55 +07:00
|
|
|
echo "--- :github: Deploy artifacts for release: ${BUILDKITE_TAG}"
|
2020-03-31 04:46:23 +07:00
|
|
|
hub release create "${BUILDKITE_TAG}" "${artifacts[@]}" -F <(echo -e "${BUILDKITE_TAG}\n\n$(awk "/${BUILDKITE_TAG}/" RS="## Breaking" BREAKING.md)\n\n## Changelog\n$(git log --oneline --pretty='* %h %s' $(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))...$(git describe --abbrev=0 --tags))\n\n## Docker Container\n* \`docker pull authelia/authelia:${BUILDKITE_TAG//v}\`" | sed -e 's/^ /## Breaking /' | sed -e '/./b' -e :n -e 'N;s/\n$//;tn'); EXIT=$?
|
2020-03-01 11:56:04 +07:00
|
|
|
|
2020-06-05 07:43:19 +07:00
|
|
|
if [[ $EXIT == 0 ]];
|
2020-03-01 11:56:04 +07:00
|
|
|
then
|
|
|
|
exit
|
|
|
|
else
|
|
|
|
hub release delete "${BUILDKITE_TAG}" && false
|
|
|
|
fi
|