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 May 12, 2022
1 parent 5aa2a44 commit 15be7f3
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 @@ -58,6 +58,10 @@ commands:
[[ "<< parameters.event >>" == "failure" ]] && message=" ❌ [${workflow_name}] Job ${job} failed on **${CIRCLE_BRANCH}**. Please see [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
[[ "<< parameters.event >>" == "success" ]] && message=" ✅ [${workflow_name}] Job ${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. If the commit is untagged, just bail out.
[[ "<< 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 @@ -81,6 +85,13 @@ commands:
event: success
condition: on_success

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

defaults:

# --------------------------------------------------------------------------
Expand Down Expand Up @@ -1456,6 +1467,7 @@ jobs:
- store_artifacts:
path: solc-bin/
- gitter_notify_failure_unless_pr
- gitter_notify_release_unless_pr

workflows:
version: 2
Expand Down

0 comments on commit 15be7f3

Please sign in to comment.