Skip to content

Commit dbcffb7

Browse files
committed
CI: Post a notification to gitter when binaries are ready
1 parent 0153822 commit dbcffb7

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.circleci/config.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ commands:
3636
parameters:
3737
event:
3838
type: enum
39-
enum: ["failure", "success"]
39+
enum: ["failure", "success", "release"]
4040
condition:
4141
type: string
4242
steps:
@@ -58,6 +58,10 @@ commands:
5858
5959
[[ "<< parameters.event >>" == "failure" ]] && message=" ❌ [${workflow_name}] Job ${job} failed on **${CIRCLE_BRANCH}**. Please see [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
6060
[[ "<< parameters.event >>" == "success" ]] && message=" ✅ [${workflow_name}] Job ${job} succeeded on **${CIRCLE_BRANCH}**. Please see [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
61+
[[ "<< parameters.event >>" == "release" ]] && message=" 📦 Release binaries for version **${CIRCLE_TAG}** are ready and attached as artifacts to [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}). **Please make sure the whole workflow succeeded before using them.**"
62+
63+
# The release notification only makes sense on tagged commits. If the commit is untagged, just bail out.
64+
[[ "<< parameters.event >>" == "release" ]] && { [[ $CIRCLE_TAG != "" ]] || { echo "Not a tagged commit - notification skipped."; exit 0; } }
6165
6266
curl "https://api.gitter.im/v1/rooms/${GITTER_NOTIFY_ROOM_ID}/chatMessages" \
6367
--request POST \
@@ -81,6 +85,13 @@ commands:
8185
event: success
8286
condition: on_success
8387

88+
gitter_notify_release_unless_pr:
89+
description: "Posts a release notification to the main room on Gitter (if not running on a PR)."
90+
steps:
91+
- gitter_notify_unless_pr:
92+
event: release
93+
condition: on_success
94+
8495
defaults:
8596

8697
# --------------------------------------------------------------------------
@@ -1462,6 +1473,7 @@ jobs:
14621473
- store_artifacts:
14631474
path: solc-bin-binaries.tar
14641475
- gitter_notify_failure_unless_pr
1476+
- gitter_notify_release_unless_pr
14651477

14661478
workflows:
14671479
version: 2

0 commit comments

Comments
 (0)