-
Notifications
You must be signed in to change notification settings - Fork 4
Releasing a new version on wordpress.org
Konrad Karpieszuk edited this page Sep 3, 2024
·
10 revisions
function wc_price_update_svn_trunk() {
cd ~/tmp
rm -rfv wc-price-history
git clone [email protected]:kkarpieszuk/wc-price-history.git
cd wc-price-history
prepare_wc_price_history_for_release
rm -rfv ../wc-price-history-svn/wc-price-history/trunk/*
cp --recursive -v . ../wc-price-history-svn/wc-price-history/trunk/
cd ../wc-price-history-svn/wc-price-history/
svn status
echo "nie zapomnij recznie dodac nowych plikow do sledzonych!"
}
function prepare_wc_price_history_for_release() {
wp i18n make-pot . languages/wc-price-history.pot
rm -rf vendor/
rm -rf node_modules/
composer install --no-dev
rm -rf tests/
rm -rf .git
rm -rf .gitignore
rm -rf .github/
rm -rf .husky/
rm -rf composer.*
rm -rf package*
rm -rf php*
rm -rf .phpunit.result.cache
rm -rf README.md
rm -rf screenshot-1.png
}
function replace_version_number() {
# Check if version number is provided
if [ -z "$1" ]; then
echo "Usage: replace_version_number <version_number>"
return 1
fi
VERSION=$1
# Function to traverse directories and replace {VERSION} with the real version number
traverse_and_replace() {
for file in "$1"/*; do
if [ -d "$file" ]; then
# Skip /vendor and /node_modules directories
if [[ "$file" == */vendor ]] || [[ "$file" == */node_modules ]]; then
continue
fi
# Recursively traverse directories
traverse_and_replace "$file"
elif [ -f "$file" ]; then
# Replace {VERSION} with the real version number in files
sed -i "s/{VERSION}/$VERSION/g" "$file"
fi
done
}
# Start traversal from the current working directory
traverse_and_replace "."
echo "Replaced {VERSION} with $VERSION in all files."
}
You have wc-price-history-svn
directory where you have the whole svn copy (it has wc-price-history
and trunk
, tags
inside)
Run from the main plugin directory:
replace_version_number 2.1
svn ci -m "Pushing x.x.x to the trunk"
In other terminal in other directory run:
svn co https://plugins.svn.wordpress.org/wc-price-history
go to cloned directory, get trunk
directory and move to some sites' plugins
directory and test if plugin works.
Go back to previous directory and run:
svn cp trunk/ tags/{x.x.x}
and run:
svn ci -m "Tagging 2.0.0"
- create it from develop as new tag
- copy changelog as release description
- upload downloaded zip
https://translate.wordpress.org/projects/wp-plugins/wc-price-history/