Skip to content
name: Deploy to WordPress.org
on:
release:
types: [published]
jobs:
tag:
name: New release
runs-on: ubuntu-latest
if: ${{ !github.event.release.prerelease }} # Skip job if it is a pre-release
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup node version and npm cache
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install Composer dependencies and dump autoload
run: |
composer install --no-dev --optimize-autoloader
composer dump-autoload
- name: Build
run: |
npm ci --no-optional
npm run build
- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
generate-zip: true
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SLUG: mailchimp
- name: Attach the wordpress.org plugin files to the Github release
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.deploy.outputs.zip-path }}
body: |
This release contains the latest updates for the WordPress plugin.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}