Deploy / WordPress #41
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 / WordPress' | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Semantic version to deploy to WordPress.org' | |
type: string | |
required: true | |
env: | |
ARTIFACT_NAME: 'coblocks-plugin' | |
ARTIFACT_ZIP: 'coblocks-plugin.zip' | |
jobs: | |
build: | |
name: Create artifact | |
uses: ./.github/workflows/deploy-create-artifact.yml | |
with: | |
checkout-ref: ${{ inputs.version }} | |
deploy: | |
name: Manual | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.version }} | |
- name: Download plugin | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: build/coblocks | |
- name: Extract Archive | |
run: | | |
cd build/coblocks | |
unzip coblocks.zip | |
ls -la | |
- name: Checkout from WordPress.org | |
run: | | |
svn co http://svn.wp-plugins.org/coblocks wp/coblocks | |
rm -rf wp/coblocks/trunk/* | |
- name: Sync code changes | |
run: | | |
cp -a build/coblocks/coblocks/* wp/coblocks/trunk/ | |
ls -la wp/coblocks/trunk/ | |
- name: Create new tag | |
run: | | |
svn cp wp/coblocks/trunk wp/coblocks/tags/${{ inputs.version }} | |
ls -la wp/coblocks/tags/${{ inputs.version }} | |
- name: Sync asset changes | |
run: | | |
rm -rf wp/coblocks/assets/* | |
cp -a .wordpress-org/* wp/coblocks/assets/ | |
ls -la wp/coblocks/assets/ | |
- name: Deploy to WordPress.org | |
run: | | |
cd wp/coblocks | |
svn add * --force | |
svn ci --no-auth-cache --username ${{ secrets.GODADDY_WPORG_USERNAME }} --password="${{ secrets.GODADDY_WPORG_PASSWORD }}" -m "Deploy ${{ inputs.version }} version of CoBlocks" |