From 24d07946b988bea83a32b8e760b3cecd50a31dc7 Mon Sep 17 00:00:00 2001 From: Laan Tungir Date: Wed, 29 Jul 2026 10:15:48 -0400 Subject: [PATCH] v0.0.60 - Release: fix increment_and_push.sh release flow (tar 'file changed' abort + set -e cleanup guard); rebuild release artifacts --- VERSION | 2 +- increment_and_push.sh | 36 +++++++++++++++++++++++++++++++----- src/version.h | 4 ++-- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index 1e7c774..b4ae2bd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.59 +0.0.60 diff --git a/increment_and_push.sh b/increment_and_push.sh index 7139298..c085dcf 100755 --- a/increment_and_push.sh +++ b/increment_and_push.sh @@ -40,7 +40,9 @@ cleanup_on_exit() { } trap cleanup_on_exit EXIT INT TERM register_cleanup() { - [[ -n "$1" ]] && CLEANUP_FILES+=("$1") + # Guard so an empty argument (e.g. a failed tarball path) does not cause + # this function to return non-zero and abort the script under `set -e`. + [[ -n "$1" ]] && CLEANUP_FILES+=("$1") || true } # --- Config ------------------------------------------------------------- @@ -280,7 +282,19 @@ build_release_binary() { create_source_tarball() { local tarball_name="${BIN_NAME}-${NEW_VERSION#v}.tar.gz" - if tar -czf "$tarball_name" \ + # Write the tarball to a temp path OUTSIDE the archived tree (.) so that + # creating it does not change the directory while tar is reading it + # (which makes tar emit "file changed as we read it" and exit 1, which + # under `set -e` would abort the whole release flow). Move it into place + # only after tar finishes. + local tmp_tarball + tmp_tarball=$(mktemp -t "${tarball_name}.XXXXXX") || return 1 + + # tar exits 1 for "file changed as we read it", which is benign here + # because the only thing changing is the tarball we are writing (now in + # /tmp). Accept exit codes 0 and 1 as success; anything else is fatal. + set +e + tar -czf "$tmp_tarball" \ --exclude="$BIN_NAME" \ --exclude='.git*' \ --exclude='*.log' \ @@ -290,11 +304,23 @@ create_source_tarball() { --exclude='tests/local-site/assets/*.m4a' \ --exclude='tests/local-site/assets/*.webm' \ --exclude='tests/local-site/assets/*.ogg' \ - . > /dev/null 2>&1; then - echo "$tarball_name" - else + . > /dev/null 2>&1 + local tar_rc=$? + set -e + + if [[ $tar_rc -ne 0 && $tar_rc -ne 1 ]]; then + rm -f "$tmp_tarball" + print_error "tar failed with exit code $tar_rc" return 1 fi + + if ! mv "$tmp_tarball" "$tarball_name" 2>/dev/null; then + rm -f "$tmp_tarball" + print_error "Failed to move tarball into place: $tarball_name" + return 1 + fi + + echo "$tarball_name" } create_gitea_release() { diff --git a/src/version.h b/src/version.h index 24d299a..540337a 100644 --- a/src/version.h +++ b/src/version.h @@ -11,9 +11,9 @@ #ifndef SOVEREIGN_BROWSER_VERSION_H #define SOVEREIGN_BROWSER_VERSION_H -#define SB_VERSION "v0.0.59" +#define SB_VERSION "v0.0.60" #define SB_VERSION_MAJOR 0 #define SB_VERSION_MINOR 0 -#define SB_VERSION_PATCH 59 +#define SB_VERSION_PATCH 60 #endif /* SOVEREIGN_BROWSER_VERSION_H */