From a21717007763464675abcd2b3c3540af135e219a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=A0=91=E4=BA=BA?= Date: Fri, 9 May 2025 05:00:21 +0900 Subject: [PATCH] ci: fix archive name and zip package --- .gitignore | 3 +++ misc/repack.sh | 16 +++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 407efd3..67cf115 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ /um-*.tar.gz /um-*.zip /.vscode + +/prepare +/dist diff --git a/misc/repack.sh b/misc/repack.sh index c77d741..7d8b502 100755 --- a/misc/repack.sh +++ b/misc/repack.sh @@ -12,17 +12,15 @@ pack() { fi local exe_dir="$(dirname "$1")" - local archive_name="$(basename "$1" ".exe")-${APP_VERSION}${suffix}" + local archive_name="$(basename "$1" ".exe")-${APP_VERSION}" local exe_name="um${suffix}" echo "archiving ${exe_name}..." - # Prepare metadata - cp README.md LICENSE "$exe_dir" - mv "$1" "${exe_dir}/${exe_name}" - + mv "$1" "${exe_name}" if [[ "$is_windows" == 1 ]]; then - zip -Xqj9 "dist/${archive_name}.zip" "${exe_name}" README.md LICENSE + echo zip -Xqj9 "dist/${archive_name}.zip" -- "${exe_name}" README.md LICENSE + exit 1 else tar \ --sort=name --format=posix \ @@ -30,11 +28,11 @@ pack() { --pax-option=delete=atime,delete=ctime \ --clamp-mtime --mtime='1970-01-01T00:00:00Z' \ --numeric-owner --owner=0 --group=0 \ - --mode=0755 \ - -c -C "$exe_dir" "${exe_name}" README.md LICENSE | + --mode=0755 -c -- \ + "${exe_name}" README.md LICENSE | gzip -9 >"dist/${archive_name}.tar.gz" fi - rm -rf "$exe_dir" + rm -rf "$exe_dir" "${exe_name}" } for exe in prepare/*/um*; do