From a889fbecb31d2a8bbc8d8bcca6d8ac8584ddf6d2 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Sat, 27 Sep 2025 22:04:06 -0300 Subject: [PATCH] release.sh: collect artifacts in intermediate dir Collect artifacts in "tmp-..." instead of final place. If build fails in the middle, we don't want to leave the artifacts directory with partial result. Also remove the build directory (with Git clone) in the end. --- release.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/release.sh b/release.sh index 3f36ecc8..343b7f7f 100755 --- a/release.sh +++ b/release.sh @@ -163,11 +163,16 @@ green " - Checking tag $1" check_tag $1 PACKAGE=loop -ARTIFACTS_DIR="${SCRIPT_DIR}/${PACKAGE}-${TAG}" +FINAL_ARTIFACTS_DIR="${SCRIPT_DIR}/${PACKAGE}-${TAG}" +ARTIFACTS_DIR="${SCRIPT_DIR}/tmp-${PACKAGE}-${TAG}-$(date +%Y%m%d-%H%M%S)" if [ -d "$ARTIFACTS_DIR" ]; then red "artifacts directory ${ARTIFACTS_DIR} already exists!" exit 1 fi +if [ -d "$FINAL_ARTIFACTS_DIR" ]; then + red "final artifacts directory ${FINAL_ARTIFACTS_DIR} already exists!" + exit 1 +fi green " - Creating artifacts directory ${ARTIFACTS_DIR}" mkdir -p "$ARTIFACTS_DIR" green " - Packaging vendor to ${ARTIFACTS_DIR}/vendor.tar.gz" @@ -232,6 +237,13 @@ for i in $SYS; do done cd "$ARTIFACTS_DIR" - green "- Producing manifest-$TAG.txt" shasum -a 256 * > manifest-$TAG.txt +cd .. + +green "- Moving artifacts directory to final place ${FINAL_ARTIFACTS_DIR}" +mv "$ARTIFACTS_DIR" "$FINAL_ARTIFACTS_DIR" + +green "- Removing the subdir used for building ${BUILD_DIR}" + +rm -r "$BUILD_DIR"