Build ZIP with tar instead of rsync
rsync is not available everywhere; tar honours the same .distignore patterns and ships with every CI runner. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JJxAHYdMfKPoN4koRc4Ci2
This commit is contained in:
parent
3e3e87b399
commit
1517e7e3bc
1 changed files with 4 additions and 6 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
# Builds build/m365-login.zip – the folder inside the archive is named after the
|
||||
# WordPress.org slug (m365-login), regardless of the repository name.
|
||||
# Only needs bash, tar and zip.
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
|
@ -11,11 +12,8 @@ STAGE="$BUILD/$SLUG"
|
|||
rm -rf "$BUILD"
|
||||
mkdir -p "$STAGE"
|
||||
|
||||
# rsync honours .distignore-style excludes.
|
||||
rsync -a --delete \
|
||||
--exclude-from="$ROOT/.distignore" \
|
||||
--exclude 'build' \
|
||||
"$ROOT/" "$STAGE/"
|
||||
# Copy everything except the patterns listed in .distignore.
|
||||
tar -C "$ROOT" --exclude-from="$ROOT/.distignore" --exclude='./build' -cf - . | tar -C "$STAGE" -xf -
|
||||
|
||||
(
|
||||
cd "$BUILD"
|
||||
|
|
@ -24,4 +22,4 @@ rsync -a --delete \
|
|||
)
|
||||
|
||||
echo "Created $BUILD/$SLUG.zip"
|
||||
unzip -l "$BUILD/$SLUG.zip" | tail -n +4 | head -n -2 | awk '{print $4}'
|
||||
( cd "$STAGE" && find . -type f | sort )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue