-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from YusukeHosonuma/welcome/slack-notification
CI: slack notification in release workflow
- Loading branch information
Showing
1 changed file
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ on: | |
types: [prereleased] | ||
|
||
jobs: | ||
build: | ||
release: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
|
@@ -20,16 +20,56 @@ jobs: | |
bundler-${{ hashFiles('Gemfile.lock') }} | ||
- name: Setup | ||
run: | | ||
bundle | ||
run: bundle | ||
|
||
- name: Test | ||
- name: Run Unit Test | ||
run: make test | ||
|
||
- name: Run Integration Test | ||
run: make integration-test | ||
|
||
- name: Lint | ||
run: make lint | ||
|
||
- name: Deploy to CocoaPods | ||
env: | ||
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | ||
run: make release | ||
|
||
- name: Write result | ||
if: always() | ||
run: echo ${{ job.status }} > job-result.txt | ||
|
||
- name: Upload job result for job slack-notify | ||
if: always() | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: result | ||
path: job-result.txt | ||
|
||
slack-notify: | ||
runs-on: ubuntu-latest | ||
needs: release | ||
if: always() | ||
|
||
steps: | ||
- name: Download result for job slack-notify | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: result | ||
|
||
- run: echo "::set-env name=JOB_RESULT::`cat ./result/job-result.txt`" | ||
|
||
# Note: | ||
# This action is run ubuntu only, because jobs are separated. | ||
- name: Slack Notification | ||
if: always() | ||
uses: rtCamp/[email protected] | ||
env: | ||
SLACK_CHANNEL: swift-pretty-print-notify | ||
SLACK_COLOR: ${{ (env.JOB_RESULT == 'success' && 'good') || 'danger' }} | ||
SLACK_ICON: https://github.com/Penginmura.png?size=48 | ||
SLACK_MESSAGE: ${{ env.JOB_RESULT }} | ||
SLACK_TITLE: Release | ||
SLACK_USERNAME: Bot | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |