Skip to content

Commit 253f600

Browse files
committed
CI: Post a notification to gitter when binaries are ready
1 parent a59b6c2 commit 253f600

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.circleci/config.yml

+13-1
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:
@@ -46,6 +46,10 @@ commands:
4646
command: |
4747
[[ "<< parameters.event >>" == "failure" ]] && message=" ❌ Nightly job **${CIRCLE_JOB}** failed on **${CIRCLE_BRANCH}**. Please see [build #${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
4848
[[ "<< parameters.event >>" == "success" ]] && message=" ✅ Nightly job **${CIRCLE_JOB}** succeeded on **${CIRCLE_BRANCH}**. Please see [build #${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
49+
[[ "<< 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.**"
50+
51+
# The release notification only makes sense on tagged commits
52+
[[ "<< parameters.event >>" == "release" ]] && { [[ $CIRCLE_TAG != "" ]] || { echo "Not a tagged commit - notification skipped."; exit 0; } }
4953
5054
curl "https://api.gitter.im/v1/rooms/${GITTER_NOTIFY_ROOM_ID}/chatMessages" \
5155
--request POST \
@@ -69,6 +73,13 @@ commands:
6973
event: success
7074
condition: on_success
7175

76+
gitter_notify_release:
77+
description: "Posts a release notification to the main room on Gitter (if not running on a PR)."
78+
steps:
79+
- gitter_notify:
80+
event: release
81+
condition: on_success
82+
7283
defaults:
7384

7485
# --------------------------------------------------------------------------
@@ -1138,6 +1149,7 @@ jobs:
11381149
../scripts/solc-bin/rename-circleci-binaries-for-solc-bin.sh
11391150
- store_artifacts:
11401151
path: solc-bin/
1152+
- gitter_notify_release
11411153

11421154
workflows:
11431155
version: 2

0 commit comments

Comments
 (0)