From b74402cd553cfecfb65ad04ef141799c2f44b162 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Thu, 11 Jan 2024 12:37:32 +0100 Subject: [PATCH 1/3] Update to latest npm matching engines.npm when publishing packages --- .github/workflows/build-plugin-zip.yml | 1 + .github/workflows/publish-npm-packages.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml index 5163a343541ca..495de8b82917d 100644 --- a/.github/workflows/build-plugin-zip.yml +++ b/.github/workflows/build-plugin-zip.yml @@ -342,6 +342,7 @@ jobs: - name: Publish packages to npm ("latest" dist-tag) run: | cd main + 'npm install --global npm@"$(jq .engines.npm package.json)"' npm ci ./bin/plugin/cli.js npm-latest --semver minor --ci --repository-path ../publish env: diff --git a/.github/workflows/publish-npm-packages.yml b/.github/workflows/publish-npm-packages.yml index ad108f5db5b04..b0b148c075a44 100644 --- a/.github/workflows/publish-npm-packages.yml +++ b/.github/workflows/publish-npm-packages.yml @@ -85,6 +85,7 @@ jobs: if: ${{ github.event.inputs.release_type == 'development' }} run: | cd cli + 'npm install --global npm@"$(jq .engines.npm package.json)"' npm ci ./bin/plugin/cli.js npm-next --ci --repository-path ../publish env: @@ -94,6 +95,7 @@ jobs: if: ${{ github.event.inputs.release_type == 'bugfix' }} run: | cd cli + 'npm install --global npm@"$(jq .engines.npm package.json)"' npm ci ./bin/plugin/cli.js npm-bugfix --ci --repository-path ../publish env: @@ -103,6 +105,7 @@ jobs: if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }} run: | cd publish + 'npm install --global npm@"$(jq .engines.npm package.json)"' npm ci npx lerna publish patch --dist-tag wp-${{ github.event.inputs.wp_version }} --no-private --yes --no-verify-access env: From 7a3f45a7ecdf83438ee91bb72b54d362f3680e85 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Thu, 11 Jan 2024 12:45:19 +0100 Subject: [PATCH 2/3] Fix jq output to remove quotes and newlines --- .github/workflows/build-plugin-zip.yml | 2 +- .github/workflows/publish-npm-packages.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml index 495de8b82917d..2c6293ed6caa0 100644 --- a/.github/workflows/build-plugin-zip.yml +++ b/.github/workflows/build-plugin-zip.yml @@ -342,7 +342,7 @@ jobs: - name: Publish packages to npm ("latest" dist-tag) run: | cd main - 'npm install --global npm@"$(jq .engines.npm package.json)"' + 'npm install --global npm@"$(jq --raw-output --join-output .engines.npm package.json)"' npm ci ./bin/plugin/cli.js npm-latest --semver minor --ci --repository-path ../publish env: diff --git a/.github/workflows/publish-npm-packages.yml b/.github/workflows/publish-npm-packages.yml index b0b148c075a44..2410f96c972b8 100644 --- a/.github/workflows/publish-npm-packages.yml +++ b/.github/workflows/publish-npm-packages.yml @@ -85,7 +85,7 @@ jobs: if: ${{ github.event.inputs.release_type == 'development' }} run: | cd cli - 'npm install --global npm@"$(jq .engines.npm package.json)"' + 'npm install --global npm@"$(jq --raw-output --join-output .engines.npm package.json)"' npm ci ./bin/plugin/cli.js npm-next --ci --repository-path ../publish env: @@ -95,7 +95,7 @@ jobs: if: ${{ github.event.inputs.release_type == 'bugfix' }} run: | cd cli - 'npm install --global npm@"$(jq .engines.npm package.json)"' + 'npm install --global npm@"$(jq --raw-output --join-output .engines.npm package.json)"' npm ci ./bin/plugin/cli.js npm-bugfix --ci --repository-path ../publish env: @@ -105,7 +105,7 @@ jobs: if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }} run: | cd publish - 'npm install --global npm@"$(jq .engines.npm package.json)"' + 'npm install --global npm@"$(jq --raw-output --join-output .engines.npm package.json)"' npm ci npx lerna publish patch --dist-tag wp-${{ github.event.inputs.wp_version }} --no-private --yes --no-verify-access env: From d0bfb29effd09e55fdfdb5d8cace3702ad343c2a Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Thu, 11 Jan 2024 16:21:31 +0100 Subject: [PATCH 3/3] Unquote steps in yaml --- .github/workflows/build-plugin-zip.yml | 2 +- .github/workflows/publish-npm-packages.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml index 2c6293ed6caa0..7e7e106cb915f 100644 --- a/.github/workflows/build-plugin-zip.yml +++ b/.github/workflows/build-plugin-zip.yml @@ -342,7 +342,7 @@ jobs: - name: Publish packages to npm ("latest" dist-tag) run: | cd main - 'npm install --global npm@"$(jq --raw-output --join-output .engines.npm package.json)"' + npm install --global npm@"$(jq --raw-output --join-output .engines.npm package.json)" npm ci ./bin/plugin/cli.js npm-latest --semver minor --ci --repository-path ../publish env: diff --git a/.github/workflows/publish-npm-packages.yml b/.github/workflows/publish-npm-packages.yml index 2410f96c972b8..ca60af6f1065f 100644 --- a/.github/workflows/publish-npm-packages.yml +++ b/.github/workflows/publish-npm-packages.yml @@ -85,7 +85,7 @@ jobs: if: ${{ github.event.inputs.release_type == 'development' }} run: | cd cli - 'npm install --global npm@"$(jq --raw-output --join-output .engines.npm package.json)"' + npm install --global npm@"$(jq --raw-output --join-output .engines.npm package.json)" npm ci ./bin/plugin/cli.js npm-next --ci --repository-path ../publish env: @@ -95,7 +95,7 @@ jobs: if: ${{ github.event.inputs.release_type == 'bugfix' }} run: | cd cli - 'npm install --global npm@"$(jq --raw-output --join-output .engines.npm package.json)"' + npm install --global npm@"$(jq --raw-output --join-output .engines.npm package.json)" npm ci ./bin/plugin/cli.js npm-bugfix --ci --repository-path ../publish env: @@ -105,7 +105,7 @@ jobs: if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }} run: | cd publish - 'npm install --global npm@"$(jq --raw-output --join-output .engines.npm package.json)"' + npm install --global npm@"$(jq --raw-output --join-output .engines.npm package.json)" npm ci npx lerna publish patch --dist-tag wp-${{ github.event.inputs.wp_version }} --no-private --yes --no-verify-access env: