Skip to content

Commit d040d35

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

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

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

7384
# --------------------------------------------------------------------------
@@ -1106,6 +1117,7 @@ jobs:
11061117
../scripts/solc-bin/rename-circleci-binaries-for-solc-bin.sh
11071118
- store_artifacts:
11081119
path: solc-bin/
1120+
- gitter_notify_release
11091121

11101122
workflows:
11111123
version: 2

0 commit comments

Comments
 (0)