From 5846caecfcf9c68c87c43ca663628958954b8ff9 Mon Sep 17 00:00:00 2001 From: Daphne Yang <139700604+daphne-sfdc@users.noreply.github.com> Date: Thu, 2 May 2024 09:50:45 -0400 Subject: [PATCH] chore: Publish in Microsoft Marketplace and Publish in Open VSX Registry GHA workflows will fail when extensions are not published (#5565) * chore: try logging into the salesforce publisher * chore: update to version 60.11.1 * chore: updated SHA256 v60.11.1 [skip ci] * chore: comment out unnecessary parts of publishVSCode.yml workflow * chore: npx vsce login salesforce instead of vsce login salesforce * chore: print result of publish * chore: try removing find * chore: use loop * chore: use set -e * chore: use -exec sh -c * chore: clean up + change back to while loop * chore: try Pete's one-liner suggestion * chore: simplify shell script command * chore: remove -o flag * revert: revert back to Pete's suggestion * Merge branch 'develop' of github.com:daphne-sfdc/salesforcedx-vscode-publish-microsoft-marketplace into daphne/W-15437641-publish-microsoft-marketplace * chore: uncomment previously commented code in publishVSCode.yml * chore: revert SHA256.md and lerna.json * chore: add echo SUCCESSFULLY published * chore: comment out extra steps in publishOpenVSX.yml * fix: replace publish command in publishOpenVSX.yml * fix: pass in OVSX_PAT as second %s argument * fix: add placeholder braces * chore: uncomment previously commented code in publishOpenVSX.yml * chore: remove redundant echo SUCCESSFULLY published --------- Co-authored-by: peternhale --- .github/workflows/publishOpenVSX.yml | 4 ++-- .github/workflows/publishVSCode.yml | 4 ++-- lerna.json | 2 +- packages/system-tests/package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publishOpenVSX.yml b/.github/workflows/publishOpenVSX.yml index 93e8a694ca..1984288fee 100644 --- a/.github/workflows/publishOpenVSX.yml +++ b/.github/workflows/publishOpenVSX.yml @@ -73,8 +73,8 @@ jobs: - name: Display downloaded vsix files run: ls -R ./extensions - run: npm ci - - run: find ./extensions -type f -name "*.vsix" -exec npx ovsx publish {} -p ${{ env.OVSX_PAT }} \; - - run: echo "SUCCESSFULLY published" + - run: | + cmd=$(find ./extensions -type f -name "*.vsix" -print0 | xargs -0 -I {} printf 'npx ovsx publish "%s" -p "%s" && ' '{}' "${OVSX_PAT}" | sed 's/ && $//') && [ -n "$cmd" ] && eval "$cmd" && echo "SUCCESSFULLY published" ctcCloseSuccess: needs: [ctc-open, publish] diff --git a/.github/workflows/publishVSCode.yml b/.github/workflows/publishVSCode.yml index a5d6d82fa0..adfd255465 100644 --- a/.github/workflows/publishVSCode.yml +++ b/.github/workflows/publishVSCode.yml @@ -72,8 +72,8 @@ jobs: - name: Display downloaded vsix files run: ls -R ./extensions - run: npm ci - - run: find ./extensions -type f -name "*.vsix" -exec npx vsce publish --pat ${{ env.VSCE_PERSONAL_ACCESS_TOKEN }} --packagePath {} \; - - run: echo "SUCCESSFULLY published" + - run: | + cmd=$(find . -type f -name "*.vsix" -print0 | xargs -0 printf 'npx vsce publish --pat "%s" --packagePath "%s" && ' "${VSCE_PERSONAL_ACCESS_TOKEN}" | sed 's/ && $//')&&[ -n "$cmd" ] && eval "$cmd" && echo "SUCCESSFULLY published" ctcCloseSuccess: needs: [ctc-open, publish] diff --git a/lerna.json b/lerna.json index 048a35a73d..fde93570c2 100644 --- a/lerna.json +++ b/lerna.json @@ -14,4 +14,4 @@ }, "useNx": true, "useWorkspaces": true -} +} \ No newline at end of file diff --git a/packages/system-tests/package.json b/packages/system-tests/package.json index c3dca09791..79d4924b5e 100644 --- a/packages/system-tests/package.json +++ b/packages/system-tests/package.json @@ -53,4 +53,4 @@ "activationEvents": [ "*" ] -} +} \ No newline at end of file