v0.0.60 - Release: fix increment_and_push.sh release flow (tar 'file changed' abort + set -e cleanup guard); rebuild release artifacts
This commit is contained in:
+31
-5
@@ -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() {
|
||||
|
||||
+2
-2
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user