Skip to content

Commit 59d0383

Browse files
committed
feat(ci): ensure production dependencies in release packages
- Add production dependency reinstall step after tests in GitHub workflow - Remove dependency installation from create-release.sh script - Script now only packages existing files without modifying dependencies
1 parent ccd0169 commit 59d0383

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

.github/workflows/build-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ jobs:
3939
chmod +x scripts/run-tests.sh
4040
./scripts/run-tests.sh
4141
42+
- name: Reinstall production dependencies
43+
run: |
44+
echo "Reinstalling production-only composer dependencies just in case..."
45+
composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction
46+
4247
- name: Generate zip file
4348
run: |
4449
chmod +x scripts/create-release.sh

scripts/create-release.sh

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -88,28 +88,8 @@ RSYNC_EXCLUDES="$RSYNC_EXCLUDES --exclude=.git --exclude=.DS_Store --exclude=*.z
8888
# Copy files using rsync with excludes
8989
rsync -av --progress $RSYNC_EXCLUDES "$PLUGIN_ROOT/" "$DEST_DIR/"
9090

91-
# Install production composer dependencies if composer.json exists and vendor is not excluded
92-
if [ -f "$DEST_DIR/composer.json" ] && [ ! -d "$DEST_DIR/includes/vendor" ]; then
93-
print_info "Installing production Composer dependencies..."
94-
cd "$DEST_DIR"
95-
composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction
96-
cd - > /dev/null
97-
else
98-
print_info "Vendor directory already exists or composer.json not found, skipping composer install"
99-
fi
100-
101-
# Build frontend assets if needed
102-
if [ -f "$DEST_DIR/package.json" ] && [ ! -d "$DEST_DIR/admin/ui/dist" ]; then
103-
print_info "Building frontend assets..."
104-
cd "$DEST_DIR"
105-
npm install --production=false
106-
npm run build
107-
# Remove node_modules after build
108-
rm -rf node_modules
109-
cd - > /dev/null
110-
else
111-
print_info "Frontend dist already exists or package.json not found, skipping build"
112-
fi
91+
# Note: Dependencies should be installed before running this script
92+
# This script only packages the existing files
11393

11494
# Create the zip file
11595
print_info "Creating zip archive..."

0 commit comments

Comments
 (0)