-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·56 lines (44 loc) · 1.19 KB
/
build.sh
File metadata and controls
executable file
·56 lines (44 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# Build script for creating a production-ready ZIP file
# This script creates a clean ZIP without development files
set -e
PLUGIN_NAME="WSCPluginSWCanonicalURLVariant"
VERSION=${1:-"latest"}
BUILD_DIR="build"
ZIP_NAME="${PLUGIN_NAME}-${VERSION}.zip"
echo "🚀 Building ${PLUGIN_NAME} v${VERSION}..."
# Clean build directory
echo "📦 Cleaning build directory..."
rm -rf ${BUILD_DIR}
mkdir -p ${BUILD_DIR}/${PLUGIN_NAME}
# Copy plugin files using git archive (respects .gitattributes)
echo "📋 Copying plugin files..."
git archive HEAD | tar -x -C ${BUILD_DIR}/${PLUGIN_NAME}
# Remove any remaining development files
echo "🧹 Removing development files..."
cd ${BUILD_DIR}/${PLUGIN_NAME}
rm -rf \
.git \
.github \
.idea \
tests \
.gitattributes \
.gitignore \
.php-cs-fixer.php \
phpunit.xml \
phpunit.xml.dist \
build.sh \
README.md \
CHANGELOG.md
cd ..
# Create ZIP
echo "📦 Creating ZIP file..."
zip -r ../${ZIP_NAME} ${PLUGIN_NAME}/ -q
cd ..
# Cleanup
echo "🧹 Cleaning up..."
rm -rf ${BUILD_DIR}
echo "✅ Build complete: ${ZIP_NAME}"
echo "📦 File size: $(du -h ${ZIP_NAME} | cut -f1)"
echo ""
echo "🎉 Ready for deployment!"