Release v66.4.2 #173
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish in Microsoft Marketplace | |
| on: | |
| release: | |
| # This limits the workflow to releases that are not pre-releases | |
| # From the docs: A release was published, or a pre-release was changed to a release. | |
| types: [released] | |
| # Button for publishing main branch in case there is a failure on the release. | |
| workflow_dispatch: | |
| jobs: | |
| prepare-environment-from-main: | |
| name: 'Get Release Version' | |
| if: github.event_name != 'release' || !startsWith(github.event.release.tag_name, 'soql-common') | |
| runs-on: ubuntu-latest | |
| environment: publish | |
| outputs: | |
| RELEASE_VERSION: ${{ steps.getMainVersion.outputs.version }} | |
| CBW_RELEASE_TYPE: ${{ steps.cbwReleaseType.outputs.type }} | |
| GUS_BUILD: ${{ steps.getGusBuild.outputs.gusBuild}} | |
| SF_CHANGE_CASE_SCHEDULE_BUILD: ${{ steps.getScheduledBuild.outputs.sfChangeCaseScheduleBuild }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: 'main' | |
| - run: git fetch --tags --quiet | |
| - id: getMainVersion | |
| run: | | |
| echo "version="$(node -pe "require('./packages/salesforcedx-vscode/package.json').version")"" >> $GITHUB_OUTPUT | |
| - run: echo "Main Version is ${{ steps.getMainVersion.outputs.version }}" | |
| - id: cbwReleaseType | |
| run: | | |
| VERSION="${{ steps.getMainVersion.outputs.version }}" | |
| PREV_TAG=$(git tag -l 'v[0-9]*' --sort=-v:refname | grep -v "^v${VERSION}$" | head -1) | |
| PREV_VERSION="${PREV_TAG#v}" | |
| CURR_MINOR=$(echo "$VERSION" | cut -d. -f1-2) | |
| PREV_MINOR=$(echo "$PREV_VERSION" | cut -d. -f1-2) | |
| if [ "$CURR_MINOR" = "$PREV_MINOR" ]; then | |
| TYPE="patch" | |
| else | |
| TYPE="minor" | |
| fi | |
| echo "type=$TYPE" >> $GITHUB_OUTPUT | |
| echo "CBW release type: $TYPE (current=$VERSION, previous=$PREV_VERSION)" | |
| - id: getGusBuild | |
| run: | | |
| echo "gusBuild=${{ steps.getMainVersion.outputs.version }}" >> $GITHUB_OUTPUT | |
| - run: echo "GUS BUILD is ${{ steps.getGusBuild.outputs.gusBuild }}" | |
| - id: getScheduledBuild | |
| run: | | |
| echo "sfChangeCaseScheduleBuild=offcore.tooling.${{ steps.getMainVersion.outputs.version }}" >> $GITHUB_OUTPUT | |
| - run: echo "SF_CHANGE_CASE_SCHEDULE_BUILD is ${{ steps.getScheduledBuild.outputs.sfChangeCaseScheduleBuild }}"\ | |
| ctc-open: | |
| needs: [prepare-environment-from-main] | |
| uses: salesforcecli/github-workflows/.github/workflows/ctcOpen.yml@main | |
| secrets: inherit | |
| publish: | |
| needs: ['ctc-open', 'prepare-environment-from-main'] | |
| runs-on: ubuntu-latest | |
| env: | |
| VSCE_PERSONAL_ACCESS_TOKEN: ${{ secrets.VSCE_PERSONAL_ACCESS_TOKEN }} | |
| PUBLISH_VERSION: ${{ needs.prepare-environment-from-main.outputs.RELEASE_VERSION }} | |
| GITHUB_TOKEN: ${{ secrets.IDEE_GH_TOKEN }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: 'main' | |
| token: ${{ secrets.IDEE_GH_TOKEN }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ vars.NODE_VERSION || 'lts/*' }} | |
| - name: downloadExtensionsFromRelease | |
| run: | | |
| mkdir ./extensions | |
| gh release download v${{ env.PUBLISH_VERSION }} -D ./extensions | |
| - name: Display downloaded vsix files | |
| run: ls -R ./extensions | |
| - uses: salesforcecli/github-workflows/.github/actions/npmInstallWithRetries@main | |
| - name: Validate VSIX OPC Part URIs | |
| run: node scripts/validate-vsix-opc.mjs ./extensions | |
| - uses: salesforcecli/github-workflows/.github/actions/retry@main | |
| with: | |
| command: | | |
| cmd=$(find . -type f -name "*.vsix" -print0 | xargs -0 -I {} printf 'npx vsce publish --skip-duplicate --pat "%s" --packagePath "%s" && ' "${VSCE_PERSONAL_ACCESS_TOKEN}" '{}' | sed 's/ && $//')&&[ -n "$cmd" ] && eval "$cmd" && echo "SUCCESSFULLY published" | |
| ctcCloseSuccess: | |
| needs: [ctc-open, publish] | |
| if: needs.ctc-open.result == 'success' && needs.publish.result == 'success' && needs.ctc-open.outputs.changeCaseId | |
| uses: salesforcecli/github-workflows/.github/workflows/ctcClose.yml@main | |
| secrets: inherit | |
| with: | |
| changeCaseId: ${{needs.ctc-open.outputs.changeCaseId}} | |
| ctcCloseFail: | |
| needs: [ctc-open, publish] | |
| if: always() && inputs.ctc && needs.ctc-open.outputs.changeCaseId && (needs.ctc-open.result != 'success' || needs.publish.result != 'success') | |
| uses: salesforcecli/github-workflows/.github/workflows/ctcClose.yml@main | |
| secrets: inherit | |
| with: | |
| changeCaseId: ${{ needs.ctc-open.outputs.changeCaseId }} | |
| status: Not Implemented | |
| # Set repo variable CBW_TRIGGER_ENABLED=false to disable dispatch to code-builder-web. | |
| # Default (unset): dispatch after publish. Use when publishing without CBW promotion. | |
| trigger-cbw-release: | |
| needs: [publish, prepare-environment-from-main] | |
| if: needs.publish.result == 'success' && vars.CBW_TRIGGER_ENABLED != 'false' | |
| continue-on-error: true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger Code Builder Web release | |
| env: | |
| GH_TOKEN: ${{ secrets.IDEE_GH_TOKEN }} | |
| run: | | |
| VERSION="${{ needs.prepare-environment-from-main.outputs.RELEASE_VERSION }}" | |
| RELEASE_TYPE="${{ needs.prepare-environment-from-main.outputs.CBW_RELEASE_TYPE }}" | |
| echo "Dispatching extension-publish event to code-builder-web with version $VERSION (release-type: $RELEASE_TYPE)" | |
| gh api repos/forcedotcom/code-builder-web/dispatches \ | |
| --method POST \ | |
| -f event_type=extension-publish \ | |
| -f "client_payload[version]=$VERSION" \ | |
| -f "client_payload[source]=publishVSCode" \ | |
| -f "client_payload[release_type]=$RELEASE_TYPE" | |
| echo "Dispatch sent successfully" |