Skip to content

Commit

Permalink
CI: Post a notification to gitter when binaries are ready
Browse files Browse the repository at this point in the history
  • Loading branch information
cameel committed Oct 25, 2021
1 parent d477c3c commit e1d56d7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ commands:
parameters:
event:
type: enum
enum: ["failure", "success"]
enum: ["failure", "success", "release"]
condition:
type: string
steps:
Expand All @@ -45,6 +45,10 @@ commands:
command: |
[[ "<< parameters.event >>" == "failure" ]] && message=" ❌ Nightly job **${CIRCLE_JOB}** failed on **${CIRCLE_BRANCH}**. Please see [build #${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
[[ "<< parameters.event >>" == "success" ]] && message=" ✅ Nightly job **${CIRCLE_JOB}** succeeded on **${CIRCLE_BRANCH}**. Please see [build #${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
[[ "<< 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.**"
# The release notification only makes sense on tagged commits
[[ "<< parameters.event >>" == "release" ]] && { [[ $CIRCLE_TAG != "" ]] || { echo "Not a tagged commit - notification skipped."; exit 0; } }
curl "https://api.gitter.im/v1/rooms/${GITTER_NOTIFY_ROOM_ID}/chatMessages" \
--request POST \
Expand All @@ -68,6 +72,13 @@ commands:
event: success
condition: on_success

gitter_notify_release:
description: "Posts a release notification to the main room on Gitter (if not running on a PR)."
steps:
- gitter_notify:
event: release
condition: on_success

defaults:

# --------------------------------------------------------------------------
Expand Down Expand Up @@ -1137,6 +1148,7 @@ jobs:
../scripts/solc-bin/rename-circleci-binaries-for-solc-bin.sh
- store_artifacts:
path: solc-bin/
- gitter_notify_release

workflows:
version: 2
Expand Down

0 comments on commit e1d56d7

Please sign in to comment.