From 070e18acd8a65d6756b87dd40f2f19c4ea88fd1e Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 25 Oct 2023 14:47:30 -0400 Subject: [PATCH] validate that wp versions match in release workflow --- .github/workflows/upload-asset-on-release.yml | 11 ++++++++++- .wp-env.json | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upload-asset-on-release.yml b/.github/workflows/upload-asset-on-release.yml index 5966160..cc15038 100644 --- a/.github/workflows/upload-asset-on-release.yml +++ b/.github/workflows/upload-asset-on-release.yml @@ -99,9 +99,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-web') && (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-web.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 diff --git a/.wp-env.json b/.wp-env.json index 49f3b76..b6d2244 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,5 +1,5 @@ { - "core": "WordPress/WordPress#tags/6.3.1", + "core": "WordPress/WordPress#tags/6.3.2", "config": { "WP_DEBUG": true, "WP_DEBUG_LOG": true,