release: retry uploading archive

Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
This commit is contained in:
Patrizio Bekerle 2025-06-23 20:01:21 +02:00
parent 4457b957d3
commit 7f5bca329a
No known key found for this signature in database
GPG key ID: 75960E6926556207

View file

@ -99,8 +99,21 @@ echo "QOWNNOTES_ARCHIVE_SIZE=$QOWNNOTES_ARCHIVE_SIZE" >>${_QQwnNotesCheckSumVarF
echo "Uploading files to GitHub..."
# upload archive and checksum files (we need to be in a git repo for that!)
gh release upload --clobber v$QOWNNOTES_VERSION ${archiveFile}*
# Upload archive and checksum files for 5minutes, retrying every 5 seconds
# We need to be in a git repo for that
timeout=$((5 * 60))
interval=5
start_time=$(date +%s)
while ! gh release upload --clobber v$QOWNNOTES_VERSION ${archiveFile}*; do
now=$(date +%s)
elapsed=$((now - start_time))
if [ $elapsed -ge $timeout ]; then
echo "Upload failed after 5 minutes."
exit 1
fi
echo "Upload failed, retrying in $interval seconds..."
sleep $interval
done
# remove everything after we are done
if [ -d $PROJECT_PATH ]; then