-
Notifications
You must be signed in to change notification settings - Fork 79
76 lines (75 loc) · 2.56 KB
/
slack-notification.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Slack Notification
on:
workflow_dispatch:
workflow_run:
workflows:
- Cli Release
branches: [main]
types:
- completed
jobs:
get-branch:
name: Get Current Branch Name
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.extract_branch.outputs.branch }}
if: ${{ github.event.workflow_run.conclusion != 'failure' }}
steps:
- name: Extract branch name
id: extract_branch
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
wait-for-releases:
name: Wait for Docker, Homebrew, RPM and Platform executables Release
runs-on: ubuntu-latest
needs: [ get-branch ]
env:
INPUT_OWNER: twilio
INPUT_REPO: twilio-cli
INPUT_GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
INPUT_REF: ${{ needs.get-branch.outputs.branch }}
INPUT_WAITING_INTERVAL: 10
INPUT_PROPAGATE_FAILURE: true
INPUT_TRIGGER_WORKFLOW: false
steps:
- name: Checkout cli repo
uses: actions/checkout@v2
- name: Wait for Docker Release
run: source .github/scripts/trigger-and-wait.sh
env:
INPUT_WORKFLOW_FILE_NAME: docker-release.yml
- name: Wait for Oclif, Homebrew and Scoop Release
run: source .github/scripts/trigger-and-wait.sh
env:
INPUT_WORKFLOW_FILE_NAME: oclif-release.yml
- name: Wait for debian executables Release
run: source .github/scripts/trigger-and-wait.sh
env:
INPUT_WORKFLOW_FILE_NAME: debian-executable-release.yml
- name: Wait for windows executables Release
run: source .github/scripts/trigger-and-wait.sh
env:
INPUT_WORKFLOW_FILE_NAME: windows-executable-release.yml
- name: Wait for RPM Build
run: source .github/scripts/trigger-and-wait.sh
env:
INPUT_WORKFLOW_FILE_NAME: rpmbuild.yml
- name: Wait for macos executables Release
run: source .github/scripts/trigger-and-wait.sh
env:
INPUT_WORKFLOW_FILE_NAME: macos-executable-release.yml
notify-complete-success:
needs: [ wait-for-releases ]
name: Notify Release Completed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEB_HOOK }}
SLACK_COLOR: "#36a64f"
SLACK_USERNAME: CLI Release Bot
SLACK_ICON_EMOJI: ":ship:"
SLACK_TITLE: 'Twilio CLI'
SLACK_MESSAGE: 'Release Completed.'
MSG_MINIMAL: actions url