2021-10-01 19:47:10 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [[ -z "${GH_CLI_TOKEN}" ]]; then
|
|
|
|
echo "Will not release because no GH_CLI_TOKEN defined"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "${GH_CLI_TOKEN}" | gh auth login --with-token
|
|
|
|
|
|
|
|
if [[ $( gh release view "${MS_TAG}" 2>&1 ) =~ "release not found" ]]; then
|
|
|
|
echo "Creating release '${MS_TAG}'"
|
|
|
|
gh release create "${MS_TAG}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd artifacts
|
|
|
|
|
2021-11-06 14:26:36 +03:00
|
|
|
set +e
|
|
|
|
|
2021-10-01 19:47:10 +03:00
|
|
|
for FILE in *
|
|
|
|
do
|
|
|
|
if [[ -f "${FILE}" ]] && [[ "${FILE}" != *.sha1 ]] && [[ "${FILE}" != *.sha256 ]]; then
|
|
|
|
echo "Uploading '${FILE}'"
|
|
|
|
gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
2021-11-06 14:03:44 +03:00
|
|
|
|
|
|
|
if [[ $? != 0 ]]; then
|
|
|
|
while true
|
|
|
|
do
|
2021-11-06 14:26:36 +03:00
|
|
|
echo "RE-Uploading '${FILE}'"
|
2021-11-06 14:03:44 +03:00
|
|
|
gh release upload --clobber "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
|
|
|
|
|
|
|
if [[ $? == 0 ]]; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
|
|
|
|
sleep 30
|
|
|
|
done
|
|
|
|
fi
|
2021-10-01 19:47:10 +03:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
cd ..
|