-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (44 loc) · 1.34 KB
/
Copy pathpublish.yml
File metadata and controls
49 lines (44 loc) · 1.34 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
name: Publish to NPM
on:
create:
jobs:
version:
runs-on: ubuntu-latest
steps:
- run: echo "${{github.ref}}"
publish:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v2
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- uses: borales/actions-yarn@v3.0.0
with:
cmd: install
- run: yarn build
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} # 跟前面步骤中的 NPM_AUTH_TOKEN 保持一致
- name: read package name
id: name
uses: notiz-dev/github-action-json-property@release
with:
path: ./package.json
prop_path: name
- name: read package version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: ./package.json
prop_path: version
# 企业微信消息
- name: WeChat Work notification by text
uses: chf007/action-wechat-work@master
env:
WECHAT_WORK_BOT_WEBHOOK: ${{secrets.WECHAT_WORK_BOT_WEBHOOK}}
with:
msgtype: text
content: "🎉 ${{steps.name.outputs.prop}} : V${{steps.version.outputs.prop}} 发布成功!"