From 501d6fe1c29956d45f27e1965d3184e7e559d024 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 25 Oct 2023 14:44:07 -0400 Subject: [PATCH] validate that wp versions match in release workflow --- .github/workflows/upload-asset-on-release.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upload-asset-on-release.yml b/.github/workflows/upload-asset-on-release.yml index 42a5210..167dde5 100644 --- a/.github/workflows/upload-asset-on-release.yml +++ b/.github/workflows/upload-asset-on-release.yml @@ -87,9 +87,18 @@ jobs: - name: Setup Registry run: printf "\n//npm.pkg.github.com/:_authToken=${{ secrets.NEWFOLD_ACCESS_TOKEN }}" >> .npmrc - - name: npm install + - name: NPM Install run: npm install --legacy-peer-deps + - name: Validate WP Versions + if: ${{ (github.repository == 'newfold-labs/wp-plugin-mojo') && (github.event.release.prerelease == false) }} + run: | + wpEnvVersion=`grep "WordPress/WordPress#tags/" .wp-env.json | grep -Eo "[0-9\.]*"` + pluginHeaderTestedVersion=`grep "Tested up to:" wp-plugin-mojo.php | grep -Eo "[0-9\.]*"` + echo "wp-env version: $wpEnvVersion" + echo "Plugin header tested version: $pluginHeaderTestedVersion" + [[ "$wpEnvVersion" == "$pluginHeaderTestedVersion" ]] || exit 1 + - name: Build JavaScript run: npm run build