From ac5c20b05bfe76820ada6daa21c5539a1d4c4809 Mon Sep 17 00:00:00 2001 From: aboyko Date: Thu, 23 May 2024 13:28:40 -0400 Subject: [PATCH] [GHA] Publish vscode-extension workflow --- .github/workflows/build-vscode-extension.yml | 1 - .../workflows/publish-vscode-extension.yml | 60 +++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish-vscode-extension.yml diff --git a/.github/workflows/build-vscode-extension.yml b/.github/workflows/build-vscode-extension.yml index 960bd4653..6bba71c1b 100644 --- a/.github/workflows/build-vscode-extension.yml +++ b/.github/workflows/build-vscode-extension.yml @@ -36,7 +36,6 @@ jobs: ${{ github.workspace }}/.github/scripts/build-vscode-extension.sh ${{ inputs.extension-name }} ${{ inputs.dist }} ls ./vsix - name: Cloudgate S3 Configuration - if: always() uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.TOOLS_CLOUDGATE_ACCESS_KEY }} diff --git a/.github/workflows/publish-vscode-extension.yml b/.github/workflows/publish-vscode-extension.yml new file mode 100644 index 000000000..4899d0272 --- /dev/null +++ b/.github/workflows/publish-vscode-extension.yml @@ -0,0 +1,60 @@ +name: Release VSCode Extension + +on: + workflow_dispatch: + inputs: + extension-name: + description: name of the extension, e.g. vscode-spring-cli + required: true + type: string + version: + description: version of the extension + required: true + type: string + postfix: + description: For example "RC1" + required: true + type: string + +jobs: + + publish-release: + runs-on: ubuntu-latest + name: Publsih '${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}' + steps: + - name: Download Release VSIX + id: download-release + run: | + vsix_file=${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix + wget https://cdn.spring.io/spring-tools/vscode-extensions/${{ inputs.extension-name }}/${{ inputs.version }}/release/$vsix_file + - name: Publish to VSCode Marketplace + id: publish-vsce + run: | + npm install --global @vscode/vsce + vsix_file=${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix + echo "vsce publish -p ${{ secrets.VSCE_PUBLISH_TOKEN }} --packagePath $vsix_file" + - name: Publish to Eclipse Open VSX + id: publish-ovsx + run: | + npm install --global ovsx + vsix_file=${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix + echo "ovsx publish -p ${{ secrets.OVSX_PUBLISH_TOKEN }} $vsix_file" +# - id: tools-team-slack +# uses: slackapi/slack-github-action@v1.26 +# env: +# SLACK_BOT_TOKEN: ${{ secrets.VMWARE_SLACK_BOT_TOKEN }} +# with: +# channel-id: "C0188MENU2J" +# payload: | +# { +# "text": "Release published `${{ inputs.extension-name }}-${{ inputs.version }}`", +# "blocks": [ +# { +# "type": "section", +# "text": { +# "type": "mrkdwn", +# "text": "Release now available on VSCode Marketplace: " +# } +# } +# ] +# }