-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GHA] Refine release vscode extension workflow
- Loading branch information
Showing
1 changed file
with
53 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,16 +36,14 @@ 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: | | ||
base_version=`jq -r .version vscode-extensions/${{ inputs.extension-name }}/package.json` | ||
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/[email protected] | ||
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 |