From 0a7c661f9e636d909514db97c01a5b9be209f49e Mon Sep 17 00:00:00 2001 From: aboyko Date: Wed, 4 Sep 2024 14:19:52 -0400 Subject: [PATCH] Try GChat notification for VSCode RCs --- .github/workflows/build-vscode-extension.yml | 41 +++++----- .../workflows/release-vscode-extension.yml | 75 ++++++++++++++----- 2 files changed, 78 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build-vscode-extension.yml b/.github/workflows/build-vscode-extension.yml index 2bd75db13..13ea543d6 100644 --- a/.github/workflows/build-vscode-extension.yml +++ b/.github/workflows/build-vscode-extension.yml @@ -59,24 +59,23 @@ jobs: aws s3 cp ./vsix/$vsix_file s3://$AWS_S3_BUCKET/$s3_path/$vsix_file --no-progress echo "version=$base_version" >> $GITHUB_OUTPUT echo "s3_url=${DOWNLOAD_URL_ROOT}/$s3_path/$vsix_file" >> $GITHUB_OUTPUT - - id: tools-team-slack - if: ${{ inputs.dist == 'release' }} - uses: slackapi/slack-github-action@v1.26 - env: - SLACK_BOT_TOKEN: ${{ secrets.VMWARE_SLACK_BOT_TOKEN }} - with: - channel-id: "C0188MENU2J" - payload: | - { - "text": "Release build `${{ inputs.extension-name }}-${{ steps.upload-release.outputs.version }}`", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Release build for `${{ inputs.extension-name }}-${{ steps.upload-release.outputs.version }}` is available: ${{ steps.upload-release.outputs.s3_url }}" - } - } - ] - } - +# - id: tools-team-slack +# if: ${{ inputs.dist == 'release' }} +# uses: slackapi/slack-github-action@v1.26 +# env: +# SLACK_BOT_TOKEN: ${{ secrets.VMWARE_SLACK_BOT_TOKEN }} +# with: +# channel-id: "C0188MENU2J" +# payload: | +# { +# "text": "Release build `${{ inputs.extension-name }}-${{ steps.upload-release.outputs.version }}`", +# "blocks": [ +# { +# "type": "section", +# "text": { +# "type": "mrkdwn", +# "text": "Release build for `${{ inputs.extension-name }}-${{ steps.upload-release.outputs.version }}` is available: ${{ steps.upload-release.outputs.s3_url }}" +# } +# } +# ] +# } diff --git a/.github/workflows/release-vscode-extension.yml b/.github/workflows/release-vscode-extension.yml index da5316867..3efae840b 100644 --- a/.github/workflows/release-vscode-extension.yml +++ b/.github/workflows/release-vscode-extension.yml @@ -74,23 +74,64 @@ jobs: aws s3 rm s3://$AWS_S3_BUCKET/$s3_path/ --recursive aws s3 cp ./vsix/$vsix_file s3://$AWS_S3_BUCKET/$s3_path/${{ steps.version.outputs.release_name }}.vsix --no-progress echo "s3_url=${DOWNLOAD_URL_ROOT}/$s3_path/${{ steps.version.outputs.release_name }}.vsix" >> $GITHUB_OUTPUT - - 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 build `${{ steps.version.outputs.release_name }}`", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Release build for `${{ steps.version.outputs.release_name }}` is available: ${{ steps.upload-release.outputs.s3_url }}" +# - 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 build `${{ steps.version.outputs.release_name }}`", +# "blocks": [ +# { +# "type": "section", +# "text": { +# "type": "mrkdwn", +# "text": "Release build for `${{ steps.version.outputs.release_name }}` is available: ${{ steps.upload-release.outputs.s3_url }}" +# } +# } +# ] +# } + - name: GChat spring-tools-team notification + run: | + curl --location --request POST '${{ secrets.TOOLS_TEAM_GCHAT_WEBHOOK_URL }}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "cards": [ + { + "header": { + "title": "${{ inputs.extension-name }} ${{ steps.version.outputs.version }}", + "subtitle": "Release Candidate ${{ inputs.postfix }}", + "imageUrl": "https://code.visualstudio.com/assets/images/code-stable.png", + "imageType": "CIRCLE" + }, + "sections": [ + { + "widgets": [ + { + "textParagraph": { + "text": "VSCode extension ${{ inputs.extension-name }} release candidate build ${{ inputs.postfix }} is available: ${{ steps.version.outputs.release_name }}.vsix" + } + }, + { + "buttonList": { + "buttons": [ + { + "text": "Download VSIX", + "onClick": { + "openLink": { + "url": "${{ steps.upload-release.outputs.s3_url }}" + } + } + } + ] + } + } + ] + } + ] } - } ] - } + }'