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 Apr 12, 2022
1 parent 402668a commit e32daef
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
[[ "<< 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 @@ -1426,6 +1437,7 @@ jobs:
../scripts/solc-bin/rename-circleci-binaries-for-solc-bin.sh
- store_artifacts:
path: solc-bin/
- gitter_notify_release_unless_pr

workflows:
version: 2
Expand Down

0 comments on commit e32daef

Please sign in to comment.