Deploy to wordpress.org #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/${PLUGIN_SLUG}/tags/${TAG_VERSION}" | |
| # 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 |