-
Notifications
You must be signed in to change notification settings - Fork 15
57 lines (56 loc) · 1.78 KB
/
release.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
name: Homebrew Release
on:
workflow_dispatch:
inputs:
formula:
description: 'Formula to release Homebrew'
default: twilio
version:
description: 'Release version - Same as CLI version'
required: true
sha:
description: 'SHA of tar file created by oclif'
pre-release:
description: 'If it is a prerelease send true as input'
default: 'false'
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout to homebrew
uses: actions/checkout@v2
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- name: Update Home Brew with latest sha and version
run: |
source .github/scripts/update-formula.sh "${{github.event.inputs.formula}}" "${{github.event.inputs.version}}" "${{github.event.inputs.sha}}"
release:
runs-on: ubuntu-latest
needs: [update]
steps:
- name: Checkout to homebrew
uses: actions/checkout@v2
- run: git pull
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{github.event.inputs.version}}
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{github.event.inputs.pre-release}}
notify-complete-fail:
if: ${{ failure() || cancelled() }}
needs: [ release ]
name: Notify Release Failed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.ALERT_SLACK_WEB_HOOK }}
SLACK_COLOR: "#ff3333"
SLACK_USERNAME: CLI Release Bot
SLACK_ICON_EMOJI: ":ship:"
SLACK_TITLE: "Twilio Cli"
SLACK_MESSAGE: 'Homebrew Release Failed'
MSG_MINIMAL: actions url