diff --git a/increment_and_push.sh b/increment_and_push.sh index d17f7b0..ecc94ff 100755 --- a/increment_and_push.sh +++ b/increment_and_push.sh @@ -199,13 +199,19 @@ build_release_binary() { create_source_tarball() { local tarball_name="signer-${NEW_VERSION#v}.tar.gz" - if tar -czf "$tarball_name" \ + # Write the archive OUTSIDE the tree being archived. Writing it into the + # current directory makes tar exit 1 with "file changed as we read it", + # which previously caused the tarball to be silently skipped. + local tarball_path + tarball_path="$(mktemp -d)/${tarball_name}" + + if tar -czf "$tarball_path" \ --exclude='target/*' \ --exclude='.git*' \ --exclude='*.log' \ --exclude='*.tar.gz' \ . > /dev/null 2>&1; then - echo "$tarball_name" + echo "$tarball_path" else return 1 fi