-
Notifications
You must be signed in to change notification settings - Fork 14
78 lines (69 loc) · 2.34 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Release
on:
push:
tags: ["v*"]
permissions: write-all
jobs:
release:
runs-on: ubuntu-latest
name: Release
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
with:
run_install: true
- run: |
cd packages/bento-design-system
pnpm version --no-git-tag-version --new-version ${{ github.ref_name }}
- name: Generate Github App Token
id: github_app_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.RELEASE_BOT_APP_ID }}
private-key: ${{ secrets.RELEASE_BOT_APP_PRIVATE_KEY }}
- name: Commit & Push changes
uses: actions-js/push@master
with:
message: ${{ github.ref_name }}
author_name: buildo-release-bot[bot]
author_email: 168835274+buildo-release-bot[bot]@users.noreply.github.com
github_token: ${{ steps.github_app_token.outputs.token }}
rebase: true
- name: Publish to npm
uses: JS-DevTools/npm-publish@v3
with:
package: "packages/bento-design-system/package.json"
token: ${{ secrets.NPM_TOKEN }}
access: "public"
provenance: true
- name: Publish to Github
uses: JS-DevTools/npm-publish@v3
with:
package: "packages/bento-design-system/package.json"
registry: "https://npm.pkg.github.com"
token: ${{ secrets.GITHUB_TOKEN }}
access: "public"
provenance: true
- uses: slackapi/[email protected]
if: ${{ job.status == 'success' }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
JOB_STATUS: ${{ job.status }}
ATTACHMENT_COLOR: "good"
with:
channel-id: bento
slack-message: ":tada: Version ${{ github.ref_name }} has been released!"
- uses: slackapi/[email protected]
if: ${{ job.status == 'failure' }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
JOB_STATUS: ${{ job.status }}
ATTACHMENT_COLOR: "danger"
with:
channel-id: bento
slack-message: ":x: Version ${{ github.ref_name }} failed to release"