* Create copy plugin files bash script so logic is not duplicated

* Exclude storybook from ZIP. Fixes woocommerce/woocommerce-blocks#2671
This commit is contained in:
Albert Juhé Lluveras 2020-08-24 10:27:58 +02:00 committed by GitHub
parent 96263cb029
commit 58788acf0b
3 changed files with 33 additions and 67 deletions

View File

@ -60,39 +60,6 @@ warning () {
echo -e "\n${YELLOW_BOLD}$1${COLOR_RESET}\n"
}
copy_dest_files() {
CURRENT_DIR=$(pwd)
cd "$1" || exit
rsync ./ "$2"/ --recursive --delete --delete-excluded \
--exclude=".*/" \
--exclude="*.md" \
--exclude=".*" \
--exclude="composer.*" \
--exclude="*.lock" \
--exclude=bin/ \
--exclude=node_modules/ \
--exclude=tests/ \
--exclude=docs/ \
--exclude=phpcs.xml \
--exclude=phpunit.xml.dist \
--exclude=CODEOWNERS \
--exclude=renovate.json \
--exclude="*.config.js" \
--exclude="*-config.js" \
--exclude="*.config.json" \
--exclude=package.json \
--exclude=package-lock.json \
--exclude=none \
--exclude=blocks.ini \
--exclude=docker-compose.yml \
--exclude=tsconfig.json \
--exclude=woocommerce-gutenberg-products-block.zip \
--exclude="zip-file/" \
--exclude=globals.d.ts
status "Done copying files!"
cd "$CURRENT_DIR" || exit
}
status "💃 Time to build a WooCommerce Blocks ZIP 🕺"
if [ -z "$NO_CHECKS" ]; then
@ -145,8 +112,8 @@ fi
status "Creating archive... 🎁"
mkdir zip-file
mkdir zip-file/build
copy_dest_files $SOURCE_PATH "$SOURCE_PATH/zip-file"
cd zip-file
sh $SOURCE_PATH/bin/copy-plugin-files.sh $SOURCE_PATH "$SOURCE_PATH/zip-file"
cd $(pwd)/zip-file
zip -r ../woocommerce-gutenberg-products-block.zip ./
cd ..
rm -r zip-file

View File

@ -0,0 +1,29 @@
cd "$1" || exit
rsync ./ "$2"/ --recursive --delete --delete-excluded \
--exclude=".*/" \
--exclude="*.md" \
--exclude=".*" \
--exclude="composer.*" \
--exclude="*.lock" \
--exclude=bin/ \
--exclude=node_modules/ \
--exclude=tests/ \
--exclude=docs/ \
--exclude=phpcs.xml \
--exclude=phpunit.xml.dist \
--exclude=CODEOWNERS \
--exclude=renovate.json \
--exclude="*.config.js" \
--exclude="*-config.js" \
--exclude="*.config.json" \
--exclude=package.json \
--exclude=package-lock.json \
--exclude=none \
--exclude=blocks.ini \
--exclude=docker-compose.yml \
--exclude=tsconfig.json \
--exclude=woocommerce-gutenberg-products-block.zip \
--exclude="zip-file/" \
--exclude=globals.d.ts \
--exclude=storybook/
echo -e "\nDone copying files!\n"

View File

@ -40,37 +40,6 @@ output_list() {
echo "$(tput setaf "$1")$2:$(tput sgr0) \"$3\""
}
# Sync dest files
copy_dest_files() {
cd "$2" || exit
rsync ./ "$3"/"$1"/ --recursive --delete --delete-excluded \
--exclude=".*/" \
--exclude="*.md" \
--exclude=".*" \
--exclude="composer.*" \
--exclude="*.lock" \
--exclude=bin/ \
--exclude=node_modules/ \
--exclude=tests/ \
--exclude=docs/ \
--exclude=phpcs.xml \
--exclude=phpunit.xml.dist \
--exclude=CODEOWNERS \
--exclude=renovate.json \
--exclude="*.config.js" \
--exclude="*-config.js" \
--exclude="*.config.json" \
--exclude=package.json \
--exclude=package-lock.json \
--exclude=none \
--exclude=blocks.ini \
--exclude=docker-compose.yml \
--exclude=tsconfig.json \
--exclude=globals.d.ts
output 2 "Done copying files!"
cd "$3" || exit
}
# Release script
echo
output 4 "BLOCKS->WordPress.org RELEASE SCRIPT"
@ -173,7 +142,8 @@ fi
# Copy GIT directory to trunk
output 2 "Copying project files to SVN trunk..."
copy_dest_files "trunk" "$GIT_PATH" "$SVN_PATH"
sh ${RELEASER_PATH}/bin/copy-plugin-files.sh "$GIT_PATH" "$SVN_PATH/trunk"
cd "$SVN_PATH"
# Update stable tag on trunk/readme.txt
if [ $IS_PRE_RELEASE = false ]; then