Deploy to WordPress.org #1
This file contains 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 | |
workflow_dispatch: | |
jobs: | |
release: | |
name: New Release${{ github.event_name == 'workflow_dispatch' && ' (dry run)' || '' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Get plugin version | |
id: get-version | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
run: | | |
echo "version=$(awk '/Stable tag: /{print $NF}' readme.txt)" >> $GITHUB_OUTPUT | |
- name: WordPress plugin deploy | |
uses: 10up/action-wordpress-plugin-deploy@stable | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
with: | |
dry-run: true | |
env: | |
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
SLUG: fast-smooth-scroll | |
VERSION: ${{ steps.get-version.outputs.version }} | |
- name: WordPress plugin deploy | |
uses: 10up/action-wordpress-plugin-deploy@stable | |
if: ${{ github.event_name != 'workflow_dispatch' }} | |
env: | |
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
SLUG: fast-smooth-scroll | |
- name: Upload release assets | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ${{github.workspace}}/${{ github.event.repository.name }}.zip |