forked from wso2/vscode-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
237 lines (221 loc) · 7.79 KB
/
release-vsix.yml
File metadata and controls
237 lines (221 loc) · 7.79 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: Release VSIX
on:
workflow_dispatch:
inputs:
isPreRelease:
required: true
type: boolean
ballerina:
description: Release Ballerina extension
type: boolean
required: true
default: false
bi:
description: Release BI extension
type: boolean
required: true
default: false
wso2-platform:
description: Release WSO2 Platform extension
type: boolean
required: true
default: false
choreo:
description: Release Choreo extension
type: boolean
required: true
default: false
apk:
description: Release APK extension
type: boolean
required: true
default: false
mi:
description: Release MI extension
type: boolean
required: true
default: false
hurl-client:
description: Release Hurl Client extension
type: boolean
required: true
default: false
ballerinaLsTag:
description: 'Override Ballerina LS download tag (latest, prerelease, v1.5.0). Overrides isPreRelease for LS download.'
type: string
required: false
default: ''
version:
type: choice
description: 'Enter the version type'
required: true
default: 'N/A'
options:
- 'patch'
- 'minor'
- 'major'
- 'N/A'
jobs:
Build:
name: Build branch - ${{ github.ref_name }}
uses: ./.github/workflows/build.yml
secrets: inherit
with:
runOnAWS: true
isPreRelease: ${{ inputs.isPreRelease }}
ballerinaLsTag: ${{ inputs.ballerinaLsTag }}
enableCache: false
ballerina: ${{ inputs.ballerina }}
wso2-platform: ${{ inputs.wso2-platform }}
choreo: ${{ inputs.choreo }}
apk: ${{ inputs.apk }}
bi: ${{ inputs.bi }}
mi: ${{ inputs.mi }}
hurl-client: ${{ inputs.hurl-client }}
version: ${{ inputs.version }}
isReleaseBuild: true
Release:
name: Release VSIX
needs: Build
timeout-minutes: 45
runs-on: codebuild-wso2_vscode-extensions-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- name: Restore build
uses: actions/download-artifact@v4
with:
name: ExtBuild
path: ./
- name: Set up workspace
run: |
unzip build.zip
rm build.zip
- name: Setup Rush
uses: gigara/setup-rush@v1.2.0
with:
pnpm: 10.10.0
node: 22.x
cache-rush: false
cache-pnpm: false
set-env: false
rush-install: true
- name: Get version
id: vsix
run: |
if [[ "${{ github.event.inputs.ballerina }}" == "true" ]]; then
file=$(ls ballerina-[0-9]*.[0-9]*.[0-9]*.vsix)
fi
if [[ "${{ github.event.inputs.bi }}" == "true" ]]; then
file=$(ls ballerina-integrator*.vsix)
fi
if [[ "${{ github.event.inputs.wso2-platform }}" == "true" ]]; then
file=$(ls wso2-platform*.vsix)
fi
if [[ "${{ github.event.inputs.choreo }}" == "true" ]]; then
file=$(ls choreo*.vsix)
fi
if [[ "${{ github.event.inputs.mi }}" == "true" ]]; then
file=$(ls micro-integrator*.vsix)
fi
if [[ "${{ github.event.inputs.hurl-client }}" == "true" ]]; then
file=$(ls hurl-client-[0-9]*.[0-9]*.[0-9]*.vsix)
fi
version=$(basename "$file" .vsix)
echo $version
echo "version=$version" >> $GITHUB_OUTPUT
- name: Set Chat API
id: chat
run: |
if [ "${{ github.event.inputs.mi }}" == "true" ]; then
echo "chatAPI=${{ secrets.MI_TEAM_CHAT_API }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event.inputs.bi }}" == "true" ] || [ "${{ github.event.inputs.ballerina }}" == "true" ]; then
echo "chatAPI=${{ secrets.BI_TEAM_CHAT_API }}" >> $GITHUB_OUTPUT
else
echo "chatAPI=${{ secrets.TOOLING_TEAM_CHAT_API }}" >> $GITHUB_OUTPUT
fi
- name: Create a release in wso2/ballerina-vscode repo
if: ${{ github.event.inputs.ballerina == 'true' }}
uses: ./.github/actions/release
with:
repo: wso2/ballerina-vscode
name: ballerina
token: ${{ secrets.CHOREO_BOT_TOKEN }}
chatAPI: ${{ steps.chat.outputs.chatAPI }}
- name: Create a release in wso2/product-ballerina-integrator repo
if: ${{ github.event.inputs.bi == 'true' }}
uses: ./.github/actions/release
with:
repo: wso2/product-ballerina-integrator
name: ballerina-integrator
token: ${{ secrets.CHOREO_BOT_TOKEN }}
chatAPI: ${{ steps.chat.outputs.chatAPI }}
- name: Create a release in wso2/vscode-extensions repo
if: ${{ github.event.inputs.wso2-platform == 'true' }}
uses: ./.github/actions/release
with:
repo: wso2/vscode-extensions
name: wso2-platform
token: ${{ secrets.CHOREO_BOT_TOKEN }}
chatAPI: ${{ steps.chat.outputs.chatAPI }}
- name: Create a release in wso2/choreo-vscode repo
if: ${{ github.event.inputs.choreo == 'true' }}
uses: ./.github/actions/release
with:
repo: wso2/choreo-vscode
name: choreo
token: ${{ secrets.CHOREO_BOT_TOKEN }}
chatAPI: ${{ steps.chat.outputs.chatAPI }}
- name: Create a release in wso2/apk repo
if: ${{ github.event.inputs.apk == 'true' }}
uses: ./.github/actions/release
with:
repo: wso2/apk
name: apk
token: ${{ secrets.CHOREO_BOT_TOKEN }}
chatAPI: ${{ steps.chat.outputs.chatAPI }}
- name: Create a release in wso2/mi-vscode repo
if: ${{ github.event.inputs.mi == 'true' }}
uses: ./.github/actions/release
with:
repo: wso2/mi-vscode
token: ${{ secrets.CHOREO_BOT_TOKEN }}
name: micro-integrator
chatAPI: ${{ steps.chat.outputs.chatAPI }}
- name: Create a release in wso2/ballerina-vscode repo for hurl-client
if: ${{ github.event.inputs.hurl-client == 'true' }}
uses: ./.github/actions/release
with:
repo: wso2/ballerina-vscode
token: ${{ secrets.CHOREO_BOT_TOKEN }}
name: hurl-client
chatAPI: ${{ secrets.TOOLING_TEAM_CHAT_API }}
- name: Create PR and notify
uses: ./.github/actions/pr
with:
version: ${{ steps.vsix.outputs.version }}
isPreRelease: ${{ github.event.inputs.isPreRelease }}
threadId: ${{ github.run_id }}
bot_username: ${{ secrets.CHOREO_BOT_USERNAME }}
bot_email: ${{ secrets.CHOREO_BOT_EMAIL }}
bot_token: ${{ secrets.CHOREO_BOT_TOKEN }}
ref_name: ${{ github.ref_name }}
ballerina: ${{ inputs.ballerina }}
bi: ${{ inputs.bi }}
wso2-platform: ${{ inputs.wso2-platform }}
choreo: ${{ inputs.choreo }}
apk: ${{ inputs.apk }}
mi: ${{ inputs.mi }}
hurl-client: ${{ inputs.hurl-client }}
chatAPI: ${{ secrets.TOOLING_TEAM_CHAT_API }}
Notify:
needs: [Release]
if: ${{ always() && contains(needs.*.result, 'failure') && github.repository == 'wso2/vscode-extensions'}}
runs-on: codebuild-wso2_vscode-extensions-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- uses: actions/checkout@v2
- name: "Failure Notification"
uses: ./.github/actions/failure-notification
with:
title: "Release Build Failed"
run_id: ${{ github.run_id }}
chat_api: ${{ secrets.TOOLING_TEAM_CHAT_API }}
repository: ${{ github.repository }}