-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce9a85b
commit 72f1678
Showing
8 changed files
with
852 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
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's a failure on the release. | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: Tag to be published | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
validate-release-environment: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
RELEASE_VERSION: ${{ steps.get-package-version.outputs.PACKAGE_VERSION }} | ||
GUS_BUILD: ${{ steps.get-gus-build.outputs.GUS_BUILD }} | ||
SF_CHANGE_CASE_SCHEDULE_BUILD: ${{ steps.get-scheduled-build.outputs.SF_CHANGE_CASE_SCHEDULE_BUILD }} | ||
steps: | ||
# Check out the release branch and get its head commit as output for later. | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: 'main' | ||
- id: get-branch-commit | ||
run: echo "COMMIT_ID=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
# Check out the tag to be released and get its head commit as output for later. | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.release.tag_name || inputs.tag }} | ||
- id: get-tag-commit | ||
run: echo "COMMIT_ID=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
# If the two commits aren't identical, the tag isn't eligible for release. | ||
- name: Fail non-matching commits | ||
if: ${{ steps.get-branch-commit.outputs.COMMIT_ID != steps.get-tag-commit.outputs.COMMIT_ID }} | ||
run: | | ||
echo "Tag commit must match latest commit in main. Branch is ${{ steps.get-branch-commit.outputs.COMMIT_ID }}. Tag is ${{ steps.get-tag-commit.outputs.COMMIT_ID }}." | ||
exit 1 | ||
# Get the `version` property from `package.json` as output for later. | ||
- name: Get package.json version property | ||
id: get-package-version | ||
run: | | ||
echo "PACKAGE_VERSION=$(cat package.json | jq '.version' | xargs)" >> $GITHUB_OUTPUT | ||
- run: echo "Package Version is ${{ steps.get-package-version.outputs.PACKAGE_VERSION }}" | ||
# Verify that the tag is of the format "vX.Y.Z", exactly matching the corresponding values in the `package.json` version property. | ||
- name: Compare tag to package.json | ||
run: | | ||
TAG=${{ github.event.release.tag_name || inputs.tag }} | ||
PACKAGE_VERSION=v${{ steps.get-package-version.outputs.PACKAGE_VERSION }} | ||
[[ ${TAG} == ${PACKAGE_VERSION} ]] || (echo "Tag name must match package.json version, prefixed by lowercase v" && exit 1) | ||
# Set other miscellaneous environment variables as outputs for later. | ||
- id: get-gus-build | ||
run: echo "GUS_BUILD=${{ steps.get-package-version.outputs.PACKAGE_VERSION }}" >> $GITHUB_OUTPUT | ||
- run: echo "GUS BUILD IS ${{ steps.get-gus-build.outputs.GUS_BUILD }}" | ||
- id: get-scheduled-build | ||
run: echo "SF_CHANGE_CASE_SCHEDULE_BUILD=offcore.tooling.${{ steps.get-package-version.outputs.PACKAGE_VERSION }}" > $GITHUB_OUTPUT | ||
- run: echo "SF_CHANGE_CASE_SCHEDULE_BUILD is ${{ steps.get-scheduled-build.outputs.SF_CHANGE_CASE_SCHEDULE_BUILD }}" | ||
|
||
ctc-open: | ||
needs: [ validate-release-environment ] | ||
uses: salesforcecli/github-workflows/.github/workflows/ctcOpen.yml@main | ||
secrets: inherit | ||
|
||
publish: | ||
needs: [ 'ctc-open', 'validate-release-environment' ] | ||
runs-on: ubuntu-latest | ||
env: | ||
VSCE_PERSONAL_ACCESS_TOKEN: ${{ secrets.VSCE_PERSONAL_ACCESS_TOKEN }} | ||
PUBLISH_VERSION: ${{ needs.validate-release-environment.outputs.RELEASE_VERSION }} | ||
GITHUB_TOKEN: ${{ secrets.IDEE_GH_TOKEN }} | ||
steps: | ||
- name: Checkout the release tag | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.release.tag_name || inputs.tag }} | ||
token: ${{ secrets.IDEE_GH_TOKEN }} | ||
# Set up node and install dependencies. | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 'lts/*' | ||
- run: yarn install --frozen-lockfile | ||
# Download the .vsix attached to the release. | ||
- name: Download Extension From Release | ||
run: | | ||
mkdir ./extensions | ||
gh release download v${{ env.PUBLISH_VERSION }} -D ./extensions | ||
- name: Display downloaded VSIX | ||
run: ls -R ./extensions | ||
- name: Publish the VSIX | ||
run: find ./extensions -type f -name "*.vsix" -exec npx vsce publish --pat ${{ env.VSCE_PERSONAL_ACCESS_TOKEN }} --packagePath {} \; | ||
- run: echo "SUCCESSFULLY PUBLISHED" | ||
|
||
ctc-close-success: | ||
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 }} | ||
|
||
ctc-close-fail: | ||
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 | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Currently, Visual Studio Code extensions are not signed or verified on the | ||
Microsoft Visual Studio Code Marketplace. Salesforce provides the Secure Hash | ||
Algorithm (SHA) of each extension that we publish. To verify the extensions, | ||
make sure that their SHA values match the values in the list below. | ||
|
||
1. Instead of installing the Visual Code Extension directly from within Visual | ||
Studio Code, download the VS Code extension that you want to check by | ||
following the instructions at | ||
https://code.visualstudio.com/docs/editor/extension-gallery#_common-questions. | ||
For example, download, | ||
https://salesforce.gallery.vsassets.io/_apis/public/gallery/publisher/salesforce/extension/salesforcedx-vscode-core/57.15.0/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage. | ||
|
||
2. From a terminal, run: | ||
|
||
shasum -a 256 <location_of_the_downloaded_file> | ||
|
||
3. Confirm that the SHA in your output matches the value in this list of SHAs. | ||
42904484bfbb7ad78f6757486a75d5eb8442886ce99d1874edef1e4865597e6e ./extensions/salesforcedx-vscode-apex-58.4.1.vsix | ||
cfe2bcb4000dc37a885c10ccb92c618c94133aa6c1ff2070431417a2955f3d70 ./extensions/salesforcedx-vscode-core-58.4.1.vsix | ||
faf777f5425ab82a7d4c2261a82c7e4da7824cace3946e5291a349e1f9d97aae ./extensions/salesforcedx-einstein-gpt-0.17.0.vsix | ||
4. Change the filename extension for the file that you downloaded from .zip to | ||
.vsix. | ||
|
||
5. In Visual Studio Code, from the Extensions view, select ... > Install from | ||
VSIX. | ||
|
||
6. Install the verified VSIX file. |
This file contains 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
This file contains 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
Oops, something went wrong.