1616 - name : Bump version
1717 id : bump_version
1818 run : echo "::set-output name=version::$(ruby .github/version.rb ${{ github.event.client_payload.version }})"
19-
2019 - name : Clean repo
2120 run : ruby .github/clean.rb
22-
2321 - name : Install openapi-generator-cli
2422 run : |
2523 npm install @openapitools/openapi-generator-cli -g
3028 -g ruby \
3129 -c ./openapi/config.yml \
3230 -t ./openapi/templates
33-
3431 - name : Checkout master
3532 run : git checkout master
36-
3733 - name : Create commit
3834 run : |
3935 git config user.name "devexperience"
@@ -42,11 +38,22 @@ jobs:
4238 git commit -m "Generated version ${{ steps.bump_version.outputs.version }}
4339
4440 This commit was automatically created by a GitHub Action to generate version ${{ steps.bump_version.outputs.version }} of this library."
45-
4641 - name : Push to master
4742 run : git push origin master
4843 env :
4944 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45+ - name : Slack notification
46+ uses : ravsamhq/notify-slack-action@v2
47+ if : always()
48+ with :
49+ status : ${{ job.status }}
50+ token : ${{ secrets.GITHUB_TOKEN }}
51+ notification_title : " {repo}: {workflow} workflow"
52+ message_format : " {emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
53+ footer : " <{workflow_url}|View Workflow>"
54+ notify_when : " failure"
55+ env :
56+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
5057 Publish :
5158 runs-on : ubuntu-latest
5259 permissions :
5966 with :
6067 ruby-version : 2.6
6168 - run : bundle install
62-
6369 - name : Publish to RubyGems
6470 run : |
6571 mkdir -p $HOME/.gem
7076 gem push *.gem
7177 env :
7278 RUBY_GEMS_API_KEY : " ${{ secrets.RUBYGEMS_AUTH_TOKEN }}"
79+ - name : Slack notification
80+ uses : ravsamhq/notify-slack-action@v2
81+ if : always()
82+ with :
83+ status : ${{ job.status }}
84+ token : ${{ secrets.GITHUB_TOKEN }}
85+ notification_title : " {repo}: {workflow} workflow"
86+ message_format : " {emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
87+ footer : " <{workflow_url}|View Workflow>"
88+ notify_when : " failure"
89+ env :
90+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
7391 Release :
7492 runs-on : ubuntu-latest
7593 steps :
@@ -82,9 +100,20 @@ jobs:
82100 - name : Read version
83101 id : read_version
84102 run : echo "::set-output name=version::$(ruby .github/version.rb)"
85-
86103 - name : Create tag and release
87104 run : |
88105 gh release create "v${{ steps.read_version.outputs.version }}"
89106 env :
90107 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
108+ - name : Slack notification
109+ uses : ravsamhq/notify-slack-action@v2
110+ if : always()
111+ with :
112+ status : ${{ job.status }}
113+ token : ${{ secrets.GITHUB_TOKEN }}
114+ notification_title : " {repo}: {workflow} workflow"
115+ message_format : " {emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
116+ footer : " <{workflow_url}|View Workflow>"
117+ notify_when : " failure"
118+ env :
119+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
0 commit comments