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-*.tar.gz
/um-*.zip /um-*.zip
/.vscode /.vscode
/prepare
/dist

View File

@ -12,17 +12,15 @@ pack() {
fi fi
local exe_dir="$(dirname "$1")" 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}" local exe_name="um${suffix}"
echo "archiving ${exe_name}..." echo "archiving ${exe_name}..."
# Prepare metadata mv "$1" "${exe_name}"
cp README.md LICENSE "$exe_dir"
mv "$1" "${exe_dir}/${exe_name}"
if [[ "$is_windows" == 1 ]]; then 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 else
tar \ tar \
--sort=name --format=posix \ --sort=name --format=posix \
@ -30,11 +28,11 @@ pack() {
--pax-option=delete=atime,delete=ctime \ --pax-option=delete=atime,delete=ctime \
--clamp-mtime --mtime='1970-01-01T00:00:00Z' \ --clamp-mtime --mtime='1970-01-01T00:00:00Z' \
--numeric-owner --owner=0 --group=0 \ --numeric-owner --owner=0 --group=0 \
--mode=0755 \ --mode=0755 -c -- \
-c -C "$exe_dir" "${exe_name}" README.md LICENSE | "${exe_name}" README.md LICENSE |
gzip -9 >"dist/${archive_name}.tar.gz" gzip -9 >"dist/${archive_name}.tar.gz"
fi fi
rm -rf "$exe_dir" rm -rf "$exe_dir" "${exe_name}"
} }
for exe in prepare/*/um*; do for exe in prepare/*/um*; do