-
Notifications
You must be signed in to change notification settings - Fork 12
74 lines (67 loc) · 2.27 KB
/
npm-publish.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
# action名称
name: Publish and Release
# 当代码合并到master分支的时候,执行下列脚本
on:
push:
branches: [master]
# 任务
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- name: 检查master分支
uses: actions/checkout@master
- name: 设置Node.js
uses: actions/setup-node@master
with:
node-version: 14
registry-url: https://registry.npmjs.org/ # 如果不配置将影响publish
- name: 安装依赖
run: npm install
- name: 构建packages
run: npm run lib
- name: 发布NPM包
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
npm publish
- name: publish 成功通知
run: echo npm 推送成功,请访问 https://jackysoft.github.io/rocket-render-doc
- name: 读取当前版本号
id: version
uses: ashley-taylor/[email protected]
with:
path: ./package.json
property: version
- name: 创建GitHub Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{steps.version.outputs.value}}
release_name: v${{steps.version.outputs.value}}
draft: false
prerelease: false
# - name: 打包Examples
# run: npm run build
# - name: 推送至 jackysoft.github.io/master
# uses: peaceiris/actions-gh-pages@v2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# EXTERNAL_REPOSITORY: jackysoft/jackysoft.github.io/ #可以新建一个mybells.github.io仓库发布到master
# PUBLISH_BRANCH: master
# PUBLISH_DIR: rocket-render
# with:
# emptyCommits: false
# - name: 打包文档
# run: npm run docs:build
# - name: 推送至 bhabgs.github.io/master
# uses: peaceiris/actions-gh-pages@v2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# EXTERNAL_REPOSITORY: jackysoft/jackysoft.github.io/ #可以新建一个mybells.github.io仓库发布到master
# PUBLISH_BRANCH: master
# PUBLISH_DIR: rocket-render-doc
# with:
# emptyCommits: false