Skip to content

Abdal Security Headers 5.1.0 #8

Abdal Security Headers 5.1.0

Abdal Security Headers 5.1.0 #8

name: Deploy to WordPress.org
on:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup SVN
run: sudo apt-get install subversion
- name: Export WordPress plugin files
run: |
rm -rf .git .github
mkdir -p wordpress-plugin
rsync -r --exclude=.git --exclude=.github --exclude=.gitignore --exclude=README.md ./ wordpress-plugin/
- name: Checkout WordPress.org SVN
run: |
svn co --depth immediates "https://plugins.svn.wordpress.org/abdal-security-headers/" svn-wordpress
cd svn-wordpress
svn update --set-depth infinity trunk
svn update --set-depth infinity tags
- name: Copy new version to trunk
run: |
rsync -r --delete wordpress-plugin/ svn-wordpress/trunk/
cd svn-wordpress
svn add --force trunk
svn commit -m "Updating to latest release" --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
- name: Tag the new release
run: |
PLUGIN_VERSION=$(grep -Eo "Version: [0-9]+\.[0-9]+\.[0-9]+" wordpress-plugin/abdal-security-headers.php | cut -d " " -f2)
echo "Detected Plugin Version: $PLUGIN_VERSION"
cd svn-wordpress
svn cp trunk tags/$PLUGIN_VERSION
svn commit -m "Tagging version $PLUGIN_VERSION" --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
svn update
env:
SVN_USERNAME: ${{ secrets.WP_SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.WP_SVN_PASSWORD }}