ci: fix archive name and zip package

This commit is contained in:
鲁树人 2025-05-09 05:00:21 +09:00
parent 1a943309fa
commit a217170077
2 changed files with 10 additions and 9 deletions

3
.gitignore vendored
View File

@ -7,3 +7,6 @@
/um-*.tar.gz
/um-*.zip
/.vscode
/prepare
/dist

View File

@ -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