-
Notifications
You must be signed in to change notification settings - Fork 211
81 lines (77 loc) · 2.86 KB
/
build-vscode-extension.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build VSCode Extension
on:
workflow_call:
inputs:
extension-name:
description: name of the extension, e.g. vscode-spring-cli
required: true
type: string
dist:
description: release, pre, snapshot
required: false
type: string
default: snapshot
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:
build-vscode-extension:
runs-on: ubuntu-latest
name: Build VSCode Extension '${{ inputs.extension-name }}'
steps:
- name: Checkout vscode-extensions code and workflow scripts
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Build .VSIX file
id: build-vsix
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
${{ github.workspace }}/.github/scripts/build-vscode-extension.sh ${{ inputs.extension-name }} ${{ inputs.dist }}
ls ./vsix
- name: Upload VSIX
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=${{ inputs.dist }}/vscode-extensions/${{ inputs.extension-name }}/$base_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 "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/[email protected]
# 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 }}"
# }
# }
# ]
# }