[GHA] Release vscode extension workflow
This commit is contained in:
49
.github/workflows/build-vscode-extension.yml
vendored
49
.github/workflows/build-vscode-extension.yml
vendored
@@ -1,7 +1,7 @@
|
||||
name: Build VSCode Extension
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
inputs:
|
||||
extension-name:
|
||||
description: name of the extension, e.g. vscode-spring-cli
|
||||
@@ -33,4 +33,51 @@ jobs:
|
||||
run: |
|
||||
${{ 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 }}
|
||||
aws-secret-access-key: ${{ secrets.TOOLS_CLOUDGATE_SECRET_KEY }}
|
||||
role-to-assume: arn:aws:iam::${{ secrets.TOOLS_CLOUDGATE_ACCOUNT_ID }}:role/${{ secrets.TOOLS_CLOUDGATE_USER }}
|
||||
role-session-name: ${{ github.run_id }}
|
||||
aws-region: us-east-1
|
||||
role-duration-seconds: 900
|
||||
role-skip-session-tagging: true
|
||||
- name: Upload Release
|
||||
id: upload-release
|
||||
if: ${{ inputs.dist == 'release' }}
|
||||
run: |
|
||||
pwd=`pwd`
|
||||
cd vscode-extensions/${{ inputs.extension-name }}
|
||||
base_version=`jq -r .version package.json`
|
||||
cd $pwd
|
||||
vsix_file=`ls ./vsix | head -n 1`
|
||||
echo "VSIX file to upload ${vsix_file}"
|
||||
s3_path=vscode-extensions/${{ inputs.extension-name }}/$base_version
|
||||
echo "S3 path: ${s3_path}"
|
||||
aws s3 rm s3://tools-spring-io/$s3_path/ --recursive
|
||||
aws s3 cp ./vsix/$file s3://tools-spring-io/$s3_path/$file --no-progress
|
||||
echo "version=$base_version" >> $GITHUB_OUTPUT
|
||||
echo "s3_url=https://cdn.spring.io/spring-tools/$s3_path/$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 }}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user