diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 9aceea95a..bd998bd8e 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -42,3 +42,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Save Plugin version + run: | + json=${{ toJSON(steps.changesets.outputs.publishedPackages) }} + echo PLUGIN_VERSION=$(echo "$json" | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV + - name: Deploy WordPress plugin + # Checks the changesets publishedPackages output + # If there is a published package named "@faustwp/wordpress-plugin" + # Then deploy the WordPress plugin + # https://github.com/changesets/action#outputs + if: contains(steps.changesets.outputs.publishedPackages.*.name, '@faustwp/wordpress-plugin') + # Use a variant of 10up/action-wordpress-plugin-deploy that allows us to specify a PLUGIN_DIR + # to support our monorepo structure. + uses: ./.github/actions/release-plugin + env: + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + PLUGIN_DIR: plugins/faustwp + SLUG: faustwp + VERSION: ${{ env.PLUGIN_VERSION }}