Version 1.1.4 #10
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
| # .github/workflows/deploy.yml | |
| name: Deploy to WordPress.org | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout GitHub repository | |
| uses: actions/checkout@v4 | |
| - name: Extract version from tag | |
| id: get_version | |
| run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | |
| - name: Install Subversion | |
| run: sudo apt-get update && sudo apt-get install -y subversion | |
| - name: Checkout WordPress.org SVN repo | |
| run: | | |
| svn checkout https://plugins.svn.wordpress.org/superdraft/ svn \ | |
| --username "${{ secrets.SVN_USERNAME }}" \ | |
| --password "${{ secrets.SVN_PASSWORD }}" \ | |
| --non-interactive --trust-server-cert | |
| - name: Sync trunk using .distignore | |
| shell: bash | |
| run: | | |
| # Convert .distignore to rsync exclude args | |
| EXCLUDES=$(cat .distignore | sed 's/^/--exclude=/' | xargs) | |
| # Run rsync and allow exit code 24 (vanished files) | |
| rsync -avz --delete $EXCLUDES ./ svn/trunk/ | |
| STATUS=$? | |
| if [ "$STATUS" != "0" ] && [ "$STATUS" != "24" ]; then | |
| echo "rsync failed with exit code $STATUS" | |
| exit $STATUS | |
| fi | |
| # Add files to SVN | |
| svn add --force svn/trunk --auto-props --parents --depth infinity -q | |
| - name: Sync assets to SVN root | |
| run: | | |
| rsync -avz --delete assets/ svn/assets/ | |
| svn add --force svn/assets --auto-props --parents --depth infinity -q | |
| - name: Show SVN status | |
| run: svn status svn | |
| - name: Commit changes to trunk and assets | |
| run: | | |
| cd svn | |
| svn commit -m "Deploy version ${RELEASE_VERSION}" \ | |
| --username "${{ secrets.SVN_USERNAME }}" \ | |
| --password "${{ secrets.SVN_PASSWORD }}" \ | |
| --non-interactive --trust-server-cert | |
| - name: Create SVN tag for the release | |
| run: | | |
| cd svn | |
| svn copy trunk tags/${RELEASE_VERSION} \ | |
| --username "${{ secrets.SVN_USERNAME }}" \ | |
| --password "${{ secrets.SVN_PASSWORD }}" \ | |
| --non-interactive --trust-server-cert | |
| svn commit -m "Tag version ${RELEASE_VERSION}" \ | |
| --username "${{ secrets.SVN_USERNAME }}" \ | |
| --password "${{ secrets.SVN_PASSWORD }}" \ | |
| --non-interactive --trust-server-cert |