-
Notifications
You must be signed in to change notification settings - Fork 5
90 lines (86 loc) · 3.12 KB
/
release.yml
File metadata and controls
90 lines (86 loc) · 3.12 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: release
on:
push:
branches:
- master
jobs:
release_please:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
releases_created: ${{ steps.release_please.outputs.releases_created }}
steps:
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
id: release_please
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
publish:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
needs: release_please
if: ${{ needs.release_please.outputs.releases_created == 'true' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
with:
package_json_file: 'package.json'
run_install: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.node-version'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- run: pnpm install
- run: pnpm release
notify:
runs-on: ubuntu-latest
needs: publish
if: ${{ always() && needs.publish.result != 'skipped' }}
steps:
- name: Notify Slack
uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"attachments": [
{
"color": "${{ needs.publish.result == 'success' && '#2EB886' || '#D90100' }}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "${{ needs.publish.result == 'success' && 'リリースが完了しました :taco-green:' || 'リリースに失敗しました :taco-red:' }}"
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Job"
},
"url": "https://github.com/kufu/tamatebako/actions/runs/${{ github.run_id }}"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ needs.publish.result == 'success' && '*Releases*: https://github.com/kufu/tamatebako/releases' || ':github: <https://github.com/kufu/tamatebako|README> に記載の手順に従って再リリースを行ってください。' }}"
}
}
]
}
]
}