mirror of
https://github.com/VSCodium/vscodium.git
synced 2024-09-11 06:45:28 +03:00
fix: deleting bad assets (#913)
This commit is contained in:
parent
848aabfe54
commit
cf48030b59
2
.github/workflows/linux.yml
vendored
2
.github/workflows/linux.yml
vendored
@ -88,7 +88,7 @@ jobs:
|
||||
|
||||
- name: Release
|
||||
env:
|
||||
GH_CLI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./release.sh
|
||||
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
||||
|
||||
|
31
release.sh
31
release.sh
@ -2,14 +2,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
if [[ -z "${GH_CLI_TOKEN}" ]]; then
|
||||
echo "Will not release because no GH_CLI_TOKEN defined"
|
||||
if [[ -z "${GITHUB_TOKEN}" ]]; then
|
||||
echo "Will not release because no GITHUB_TOKEN defined"
|
||||
exit
|
||||
fi
|
||||
|
||||
gh --version
|
||||
|
||||
echo "${GH_CLI_TOKEN}" | gh auth login --with-token
|
||||
npm install -g github-release-cli
|
||||
|
||||
if [[ $( gh release view "${MS_TAG}" 2>&1 ) =~ "release not found" ]]; then
|
||||
echo "Creating release '${MS_TAG}'"
|
||||
@ -23,26 +21,31 @@ set +e
|
||||
for FILE in *
|
||||
do
|
||||
if [[ -f "${FILE}" ]] && [[ "${FILE}" != *.sha1 ]] && [[ "${FILE}" != *.sha256 ]]; then
|
||||
echo "Uploading '${FILE}' at $( date )"
|
||||
gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
||||
echo "Uploading '${FILE}' at $( date "+%T" )"
|
||||
EXIT_STATUS=$( gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256" )
|
||||
|
||||
if ! (( $? )); then
|
||||
if ! (( $EXIT_STATUS )); then
|
||||
for (( i=0; i<10; i++ ))
|
||||
do
|
||||
github-release delete --owner VSCodium --repo vscodium --tag "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
||||
|
||||
sleep $(( 15 * (i + 1)))
|
||||
|
||||
echo "RE-Uploading '${FILE}' at $( date )"
|
||||
gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256" --clobber
|
||||
echo "exit: $?"
|
||||
echo "RE-Uploading '${FILE}' at $( date "+%T" )"
|
||||
EXIT_STATUS=$( gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256" )
|
||||
echo "exit: $EXIT_STATUS"
|
||||
|
||||
if ! (( $? )); then
|
||||
if ! (( $EXIT_STATUS )); then
|
||||
break
|
||||
fi
|
||||
done
|
||||
echo "exit: $?"
|
||||
echo "exit: $EXIT_STATUS"
|
||||
|
||||
if (( $? )); then
|
||||
if (( $EXIT_STATUS )); then
|
||||
echo "'${FILE}' hasn't been uploaded!"
|
||||
|
||||
github-release delete --owner VSCodium --repo vscodium --tag "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user