[GHA] Refine release vscode extension workflow
This commit is contained in:
64
.github/workflows/release-vscode-extension.yml
vendored
64
.github/workflows/release-vscode-extension.yml
vendored
@@ -11,10 +11,23 @@ on:
|
||||
description: For example "RC1"
|
||||
required: true
|
||||
type: string
|
||||
tag:
|
||||
description: tags the repository if value is true
|
||||
required: true
|
||||
type: boolean
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.CDN_S3_ACCESS_KEY }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CDN_S3_SECRET_KEY }}
|
||||
AWS_DEFAULT_REGION: us-east-1
|
||||
AWS_ENDPOINT_URL_S3: ${{ secrets.CDN_S3_ENDPOINT }}
|
||||
AWS_S3_BUCKET: ${{ secrets.CDN_BUCKET }}/spring-tools
|
||||
DOWNLOAD_URL_ROOT: https://cdn.spring.io/spring-tools
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
tag-vscode-extension:
|
||||
@@ -23,9 +36,6 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout vscode-extension '${{ inputs.extension-name }}'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: |
|
||||
vscode-extensions/${{ inputs.extension-name }}
|
||||
- name: Record Extension Version
|
||||
id: version
|
||||
run: |
|
||||
@@ -33,6 +43,7 @@ jobs:
|
||||
echo "Version: ${base_version}"
|
||||
echo "version=$base_version" >> $GITHUB_OUTPUT
|
||||
- name: Create tag
|
||||
if: ${{ inputs.tag }}
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
@@ -42,12 +53,43 @@ jobs:
|
||||
ref: 'refs/tags/${{ inputs.extension-name }}-${{ steps.version.outputs.version }}-${{ inputs.postfix }}',
|
||||
sha: context.sha
|
||||
})
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
- name: Build .VSIX file
|
||||
id: build-vsix
|
||||
run: |
|
||||
${{ github.workspace }}/.github/scripts/build-vscode-extension.sh ${{ inputs.extension-name }} release
|
||||
ls ./vsix
|
||||
- name: Upload VSIX
|
||||
id: upload-release
|
||||
run: |
|
||||
vsix_file=`ls ./vsix | head -n 1`
|
||||
echo "VSIX file to upload ${vsix_file}"
|
||||
s3_path=release/vscode-extensions/${{ inputs.extension-name }}/${{ steps.version.outputs.version }}
|
||||
echo "S3 path: ${s3_path}"
|
||||
aws s3 rm s3://$AWS_S3_BUCKET/$s3_path/ --recursive
|
||||
aws s3 cp ./vsix/$vsix_file s3://$AWS_S3_BUCKET/$s3_path/$vsix_file --no-progress
|
||||
echo "s3_url=${DOWNLOAD_URL_ROOT}/$s3_path/$vsix_file" >> $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 `${{ inputs.extension-name }}-${{ steps.version.outputs.version }}`",
|
||||
"blocks": [
|
||||
{
|
||||
"type": "section",
|
||||
"text": {
|
||||
"type": "mrkdwn",
|
||||
"text": "Release build for `${{ inputs.extension-name }}-${{ steps.version.outputs.version }}` is available: ${{ steps.upload-release.outputs.s3_url }}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
release-build-upload:
|
||||
needs: [ tag-vscode-extension ]
|
||||
uses: ./.github/workflows/build-vscode-extension.yml
|
||||
name: Build and Upload VSCode Extension '${{ inputs.extension-name }}' Release
|
||||
with:
|
||||
extension-name: ${{ inputs.extension-name }}
|
||||
dist: 'release'
|
||||
secrets: inherit
|
||||
|
||||
Reference in New Issue
Block a user