Skip to content

Deploy to wordpress.org #3

Deploy to wordpress.org

Deploy to wordpress.org #3

Workflow file for this run

name: Deploy to wordpress.org
on:
release:
types: [published]
jobs:
deploy:
name: Deploy to WordPress.org
if: github.event.release.prerelease != true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Delete existing SVN tag if exists
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
PLUGIN_SLUG: user-registration
run: |
TAG_VERSION="${{ github.event.release.tag_name }}"
TAG_VERSION="${TAG_VERSION#v}" # strip leading 'v' if present e.g v5.1.3 -> 5.1.3
SVN_TAG_URL="https://plugins.svn.wordpress.org/user-registration/tags/5.1.3/"
# Check if tag exists before trying to delete
if svn info "$SVN_TAG_URL" --username "$SVN_USERNAME" --password "$SVN_PASSWORD" > /dev/null 2>&1; then
echo "Tag ${TAG_VERSION} exists, deleting..."
svn delete "$SVN_TAG_URL" \
--username "$SVN_USERNAME" \
--password "$SVN_PASSWORD" \
-m "Removing incomplete tag ${TAG_VERSION} for redeployment"
else
echo "Tag ${TAG_VERSION} does not exist, skipping delete."
fi
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@master
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SLUG: user-registration