File tree Expand file tree Collapse file tree 1 file changed +23
-20
lines changed Expand file tree Collapse file tree 1 file changed +23
-20
lines changed Original file line number Diff line number Diff line change 31
31
artifacts_url=$( echo $latest_run | jq .artifacts_url --raw-output)
32
32
head_sha=$( echo $latest_run | jq .head_sha --raw-output)
33
33
34
- dispatch_release_event () {
35
- local release_id=$1
36
- local body=$( cat << EOS
37
- {
38
- "event_type": "release_created",
39
- "client_payload": {
40
- "toolchain_channel": "$channel ",
41
- "ref": "$head_sha ",
42
- "release_id": "$release_id "
43
- }
44
- }
45
- EOS
46
- )
47
-
48
- github --request POST --fail \
49
- --url " ${gh_api} /repos/swiftwasm/swiftwasm-buildbot/dispatches" \
50
- --data " $body "
51
- }
52
-
53
34
get_artifact_url () {
54
35
local name=$1
55
36
github $artifacts_url --fail | jq " .artifacts[] | select(.name == \" $name \" ) | .archive_download_url" | sed ' s/\"//g'
@@ -248,6 +229,28 @@ for package in ${release_packages[@]}; do
248
229
upload_tarball $release_id " $package "
249
230
done
250
231
251
- dispatch_release_event " $release_id "
232
+ dispatch_release_event () {
233
+ local release_id=$1
234
+ local body=$( cat << EOS
235
+ {
236
+ "event_type": "release_created",
237
+ "client_payload": {
238
+ "toolchain_channel": "$channel ",
239
+ "ref": "$head_sha ",
240
+ "release_id": "$release_id "
241
+ }
242
+ }
243
+ EOS
244
+ )
245
+
246
+ curl --header " authorization: Bearer $BUILDBOT_GITHUB_TOKEN " \
247
+ --request POST --fail \
248
+ --url " ${gh_api} /repos/swiftwasm/swiftwasm-buildbot/dispatches" \
249
+ --data " $body "
250
+ }
251
+
252
+ if [[ ! -z " $BUILDBOT_GITHUB_TOKEN " ]]; then
253
+ dispatch_release_event " $release_id "
254
+ fi
252
255
253
256
popd
You can’t perform that action at this time.
0 commit comments