Tips and tricks

How to add a plugin to the WordPress repository

Install the svn via homebrew or from their website

brew install svn

Update the plugin

cd /Users/raduh/Dropbox/hosts/devsite/wpenabledebug/svn2
svn co https://plugins.svn.wordpress.org/your-plugin/
cd your-plugin
svn add trunk/*
svn ci -m 'Adding first version of my plugin'
svn cp trunk tags/2.0
svn ci -m "tagging version 2.0"
push a version:

you can use to resolve conflicts

svn status
svn commit -m "Fixes after initial release"
confirm tags:
svn list https://plugins.svn.wordpress.org/dzs-video-block-for-youtube/tags
create a tag:
svn copy \
https://plugins.svn.wordpress.org/dzs-video-block-for-youtube/trunk \
https://plugins.svn.wordpress.org/dzs-video-block-for-youtube/tags/1.0.10 \
-m "Hotfix release 1.0.10"
check what is live:
svn cat https://plugins.svn.wordpress.org/dzs-video-block-for-youtube/trunk/README.md | grep "Stable tag"
useful tips:

you can use to resolve conflicts

svn update
svn resolve
deploy from git to svn:

you can use this script

#!/usr/bin/env bash
set -e

PLUGIN_SLUG="dzs-video-block-for-youtube"
VERSION="$1"

if [ -z "$VERSION" ]; then
echo "โŒ Usage: ./deploy-wporg.sh <version>"
exit 1
fi

GIT_DIR="$PWD"
SVN_DIR="$HOME/dev/${PLUGIN_SLUG}-svn"

echo "๐Ÿšง Building assets..."
npm install
npm run build

echo "๐Ÿงน Cleaning SVN trunk..."
rm -rf "$SVN_DIR/trunk/*"

echo "๐Ÿ“ฆ Syncing files to SVN trunk..."
rsync -av --delete \
--exclude=".git" \
--exclude="node_modules" \
--exclude="deploy-wporg.sh" \
--exclude="*.map" \
"$GIT_DIR/" "$SVN_DIR/trunk/"

cd "$SVN_DIR"

echo "โž• SVN add/remove..."
svn add trunk/* --force
svn status | grep '^!' | awk '{print $2}' | xargs -r svn delete

echo "๐Ÿ“ค Committing trunk..."
svn commit -m "Release $VERSION"

echo "๐Ÿท Creating SVN tag $VERSION..."
svn copy \
https://plugins.svn.wordpress.org/$PLUGIN_SLUG/trunk \
https://plugins.svn.wordpress.org/$PLUGIN_SLUG/tags/$VERSION \
-m "Tagging $VERSION"

echo "โœ… Deployment complete: $VERSION"

Leave a comment

Your email address will not be published

{"type":"main_options","images_arr":"'#ffffff'","bg_slideshow_time":"0","site_url":"https:\/\/digitalzoomstudio.net","theme_url":"https:\/\/digitalzoomstudio.net\/wp-content\/themes\/qucreative\/","is_customize_preview":"off","gallery_w_thumbs_autoplay_videos":"off","base_url":"https:\/\/digitalzoomstudio.net"}