From 9075f4e4d099a7c678e0a3e7a1cf7ad0cddb20f5 Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 12:33:40 -0500 Subject: [PATCH 01/19] init setup --- .github/workflows/release-packages.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 9aceea95a..cb2986420 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -42,3 +42,21 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Save env var + run: | + version=$(echo "$json" | jq '.[] | select(.name == "@xx/xx") | .version') + - 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: '$version' From 334e3f18149936d218ebada663154a09636df777 Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 12:42:35 -0500 Subject: [PATCH 02/19] updated to use github env --- .github/workflows/release-packages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index cb2986420..2cc6cc91c 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -44,7 +44,7 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Save env var run: | - version=$(echo "$json" | jq '.[] | select(.name == "@xx/xx") | .version') + PLUGIN_VERSION=$(echo "$json" | jq '.[] | select(.name == "@xx/xx") | .version') >> $GITHUB_ENV - name: Deploy WordPress plugin # Checks the changesets publishedPackages output # If there is a published package named "@faustwp/wordpress-plugin" @@ -59,4 +59,4 @@ jobs: SVN_USERNAME: ${{ secrets.SVN_USERNAME }} PLUGIN_DIR: plugins/faustwp SLUG: faustwp - VERSION: '$version' + VERSION: ${{ env.PLUGIN_VERSION }} From b6c9716205cfd63d1f484af6c228690dde6878a9 Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 12:54:39 -0500 Subject: [PATCH 03/19] added echo to run --- .github/workflows/release-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 2cc6cc91c..2ec23809d 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -44,7 +44,7 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Save env var run: | - PLUGIN_VERSION=$(echo "$json" | jq '.[] | select(.name == "@xx/xx") | .version') >> $GITHUB_ENV + echo PLUGIN_VERSION=$(echo "$json" | jq '.[] | select(.name == "@xx/xx") | .version') >> $GITHUB_ENV - name: Deploy WordPress plugin # Checks the changesets publishedPackages output # If there is a published package named "@faustwp/wordpress-plugin" From ea0617af25df4f712c78f7f7c9a1002ef6523f62 Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 14:51:45 -0500 Subject: [PATCH 04/19] updated for package and json string --- .github/workflows/release-packages.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 2ec23809d..9f65c350f 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -42,9 +42,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Save env var + - name: Save Plugin version run: | - echo PLUGIN_VERSION=$(echo "$json" | jq '.[] | select(.name == "@xx/xx") | .version') >> $GITHUB_ENV + json=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" From a101e476c804562cea33dea25e3390a76118dc0b Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:00:07 -0500 Subject: [PATCH 05/19] test yaml --- .github/workflows/test.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..a52fb2e25 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,20 @@ +name: Test Plugin Version +on: + push: + branches: + - feature/mw-merl-1136 + +jobs: + test_plugin_version: + name: Test Plugin Version + runs-on: ubuntu-latest + steps: + - name: Set variables + id: data + run: | + echo "packages='[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@faustwp/wordpress-plugin", "version": "0.8.9"}]'" >> $GITHUB_OUPUT + - name: Save Plugin version + run: | + json=steps.data.outputs.packages + echo PLUGIN_VERSION=$(echo "$json" | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV + echo "${{ env.PLUGIN_VERSION }}" From f2994411fb09c54136a839a0b7acb42c59216ca2 Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:01:43 -0500 Subject: [PATCH 06/19] typo --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a52fb2e25..952c5186a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: - name: Set variables id: data run: | - echo "packages='[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@faustwp/wordpress-plugin", "version": "0.8.9"}]'" >> $GITHUB_OUPUT + echo "packages='[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@faustwp/wordpress-plugin", "version": "0.8.9"}]'" >> $GITHUB_OUTPUT - name: Save Plugin version run: | json=steps.data.outputs.packages From b345279e5c5534520936633845ccfe7378020cd0 Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:04:04 -0500 Subject: [PATCH 07/19] variable testing --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 952c5186a..9f28ed2b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,6 @@ jobs: echo "packages='[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@faustwp/wordpress-plugin", "version": "0.8.9"}]'" >> $GITHUB_OUTPUT - name: Save Plugin version run: | - json=steps.data.outputs.packages + json=${{ steps.data.outputs.packages }} echo PLUGIN_VERSION=$(echo "$json" | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV echo "${{ env.PLUGIN_VERSION }}" From 2b491da37fe8ed6269e6e5a836911486745d959c Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:06:06 -0500 Subject: [PATCH 08/19] Update test.yml --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f28ed2b2..49562ec98 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,4 +17,3 @@ jobs: run: | json=${{ steps.data.outputs.packages }} echo PLUGIN_VERSION=$(echo "$json" | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV - echo "${{ env.PLUGIN_VERSION }}" From e0efb9786ff515654301f010dff7f030bde9f6e1 Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:09:22 -0500 Subject: [PATCH 09/19] Update test.yml --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 49562ec98..bd1b2ed73 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,4 +16,7 @@ jobs: - name: Save Plugin version run: | json=${{ steps.data.outputs.packages }} - echo PLUGIN_VERSION=$(echo "$json" | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV + echo PLUGIN_VERSION=$(echo $json | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV + - name: Echo output + run: | + echo "${{ env.PLUGIN_VERSION }}" From d15f2cfe11548ed455c6fa527a099ff3b81ee1ac Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:10:35 -0500 Subject: [PATCH 10/19] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd1b2ed73..b80b56c22 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: - name: Save Plugin version run: | json=${{ steps.data.outputs.packages }} - echo PLUGIN_VERSION=$(echo $json | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV + echo PLUGIN_VERSION=$(echo $json | jq '.[] | select(.name == \"@faustwp/wordpress-plugin\") | .version') >> $GITHUB_ENV - name: Echo output run: | echo "${{ env.PLUGIN_VERSION }}" From 46fb9be7ed968a3daebcfdc5ff3e9ada19b18cbb Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:12:16 -0500 Subject: [PATCH 11/19] Update test.yml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b80b56c22..48ed303e8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: - name: Save Plugin version run: | json=${{ steps.data.outputs.packages }} - echo PLUGIN_VERSION=$(echo $json | jq '.[] | select(.name == \"@faustwp/wordpress-plugin\") | .version') >> $GITHUB_ENV + echo PLUGIN_VERSION=$(echo $json | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV - name: Echo output run: | - echo "${{ env.PLUGIN_VERSION }}" + echo "${{ steps.data.outputs.packages }}" From 2dc4813925e70927335a4798bff6b0a792bc8eee Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:13:50 -0500 Subject: [PATCH 12/19] Update test.yml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 48ed303e8..bf62c9902 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,8 +15,8 @@ jobs: echo "packages='[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@faustwp/wordpress-plugin", "version": "0.8.9"}]'" >> $GITHUB_OUTPUT - name: Save Plugin version run: | - json=${{ steps.data.outputs.packages }} + json=${{ fromJSON(steps.data.outputs.packages) }} echo PLUGIN_VERSION=$(echo $json | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV - name: Echo output run: | - echo "${{ steps.data.outputs.packages }}" + echo "${{ env.PLUGIN_VERSION }}" From 7557a0dfb1bdcb41f6ae8f12de08ac51cdc79ae8 Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:14:50 -0500 Subject: [PATCH 13/19] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bf62c9902..570c87b86 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: echo "packages='[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@faustwp/wordpress-plugin", "version": "0.8.9"}]'" >> $GITHUB_OUTPUT - name: Save Plugin version run: | - json=${{ fromJSON(steps.data.outputs.packages) }} + json=${{ toJSON(steps.data.outputs.packages) }} echo PLUGIN_VERSION=$(echo $json | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV - name: Echo output run: | From eb4611df2fe5f96d3dffb115a4e411ff774c35c9 Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:16:12 -0500 Subject: [PATCH 14/19] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 570c87b86..276728698 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: - name: Set variables id: data run: | - echo "packages='[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@faustwp/wordpress-plugin", "version": "0.8.9"}]'" >> $GITHUB_OUTPUT + echo "packages='[{"name": "\@xx/xx", "version": "1.2.0"}, {"name": "\@faustwp/wordpress-plugin", "version": "0.8.9"}]'" >> $GITHUB_OUTPUT - name: Save Plugin version run: | json=${{ toJSON(steps.data.outputs.packages) }} From f2dab246bc95d54516c28d6a7366d60824c0aa7f Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:17:37 -0500 Subject: [PATCH 15/19] Update test.yml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 276728698..4833cf8d7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,11 +12,11 @@ jobs: - name: Set variables id: data run: | - echo "packages='[{"name": "\@xx/xx", "version": "1.2.0"}, {"name": "\@faustwp/wordpress-plugin", "version": "0.8.9"}]'" >> $GITHUB_OUTPUT + echo "packages='[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@faustwp/wordpress-plugin", "version": "0.8.9"}]'" >> $GITHUB_OUTPUT - name: Save Plugin version run: | json=${{ toJSON(steps.data.outputs.packages) }} - echo PLUGIN_VERSION=$(echo $json | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV + echo PLUGIN_VERSION=$(echo "$json" | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV - name: Echo output run: | echo "${{ env.PLUGIN_VERSION }}" From d559a8b81e886c1c98dccdcc9dcbe57cd7dc3766 Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:18:28 -0500 Subject: [PATCH 16/19] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4833cf8d7..38d285fc7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: - name: Save Plugin version run: | json=${{ toJSON(steps.data.outputs.packages) }} - echo PLUGIN_VERSION=$(echo "$json" | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV + echo PLUGIN_VERSION="testing" >> $GITHUB_ENV - name: Echo output run: | echo "${{ env.PLUGIN_VERSION }}" From 81e177e3ecab80dde31e5d818f4fd73bd264c3d4 Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:20:11 -0500 Subject: [PATCH 17/19] Update test.yml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 38d285fc7..0ccbc30b0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,11 +12,11 @@ jobs: - name: Set variables id: data run: | - echo "packages='[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@faustwp/wordpress-plugin", "version": "0.8.9"}]'" >> $GITHUB_OUTPUT + echo packages='[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@faustwp/wordpress-plugin", "version": "0.8.9"}]' >> $GITHUB_OUTPUT - name: Save Plugin version run: | json=${{ toJSON(steps.data.outputs.packages) }} - echo PLUGIN_VERSION="testing" >> $GITHUB_ENV + echo PLUGIN_VERSION=$(echo "$json" | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV - name: Echo output run: | echo "${{ env.PLUGIN_VERSION }}" From 23211861169ff895a22e83b356d8274fde20ff6b Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Thu, 24 Aug 2023 15:22:24 -0500 Subject: [PATCH 18/19] updated after testing --- .github/workflows/release-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 9f65c350f..bd998bd8e 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -44,7 +44,7 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Save Plugin version run: | - json=steps.changesets.outputs.publishedPackages + 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 From 7c9456d71300a38dd4cfeed2075e1834696f348a Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Fri, 25 Aug 2023 17:11:17 -0500 Subject: [PATCH 19/19] removed test file --- .github/workflows/test.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 0ccbc30b0..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Test Plugin Version -on: - push: - branches: - - feature/mw-merl-1136 - -jobs: - test_plugin_version: - name: Test Plugin Version - runs-on: ubuntu-latest - steps: - - name: Set variables - id: data - run: | - echo packages='[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@faustwp/wordpress-plugin", "version": "0.8.9"}]' >> $GITHUB_OUTPUT - - name: Save Plugin version - run: | - json=${{ toJSON(steps.data.outputs.packages) }} - echo PLUGIN_VERSION=$(echo "$json" | jq '.[] | select(.name == "@faustwp/wordpress-plugin") | .version') >> $GITHUB_ENV - - name: Echo output - run: | - echo "${{ env.PLUGIN_VERSION }}"