Workflow file for this run
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 plugin to WordPress.org | |
on: | |
release: | |
types: [ published ] | |
workflow_dispatch: | |
inputs: | |
debug_enabled_deployment: | |
type: boolean | |
description: 'Enable "tmate" debugging for the deployment' | |
required: false | |
default: false | |
jobs: | |
code-check: | |
name: Check the code | |
uses: ./.github/workflows/code-check.yml | |
secrets: inherit | |
deploy-wp-org: | |
name: Deploy the new tag | |
needs: code-check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install linux packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y iproute2 | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup tmate session for Debugging, if inputs.debug_enabled_deployment is true | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ inputs.debug_enabled_deployment }} | |
timeout-minutes: 10 | |
with: | |
detached: true | |
- name: Build the package on ./dev-workspace | |
run: | | |
cd $GITHUB_WORKSPACE/dev-workspace | |
sh run composer build | |
- name: WordPress.org plugin deploy | |
uses: 10up/action-wordpress-plugin-deploy@stable | |
env: | |
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
SLUG: post-expirator | |
BUILD_DIR: ${{ github.workspace }}/dist/post-expirator | |
- name: Save version number to version.txt | |
run: | | |
cd $GITHUB_WORKSPACE/dev-workspace | |
sh run composer get:version | |
- name: Get version number from version.txt | |
id: get-version | |
run: echo "version=$(cat $GITHUB_WORKSPACE/version.txt)" >> "$GITHUB_OUTPUT" | |
- name: Upload release asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ${{ github.workspace }}/dist/ | |
asset_name: publishpress-future-${{ steps.get-version.outputs.version }}.zip | |
asset_content_type: application/zip |