Skip to content

Commit 387e02c

Browse files
Dispatch buildbot repo event after creating a new tag
1 parent bbafd56 commit 387e02c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

utils/webassembly/distribute-latest-toolchain.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,25 @@ fi
3434
artifacts_url=$(echo $latest_run | jq .artifacts_url --raw-output)
3535
head_sha=$(echo $latest_run | jq .head_sha --raw-output)
3636

37+
dispatch_release_event() {
38+
local release_id=$1
39+
local body=$(cat <<EOS
40+
{
41+
"event_type": "release_created",
42+
"client_payload": {
43+
"toolchain_channel": "$channel",
44+
"ref": "$head_sha",
45+
"release_id": "$release_id"
46+
}
47+
}
48+
EOS
49+
)
50+
51+
github --request POST --fail \
52+
--url "${gh_api}/repos/swiftwasm/swiftwasm-buildbot/dispatches" \
53+
--data "$body"
54+
}
55+
3756
get_artifact_url() {
3857
local name=$1
3958
github $artifacts_url --fail | jq ".artifacts[] | select(.name == \"$name\") | .archive_download_url" | sed 's/\"//g'
@@ -225,4 +244,6 @@ for package in ${release_packages[@]}; do
225244
upload_tarball $release_id "$package"
226245
done
227246

247+
dispatch_release_event "$release_id"
248+
228249
popd

0 commit comments

Comments
 (0)