-
Notifications
You must be signed in to change notification settings - Fork 61
45 lines (36 loc) · 1.06 KB
/
workflow.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
# .github/workflows/semantic-release.yml
# workflow name(在 Github Actions 控制面板中)
name: Actions Release
# event type(此处我们选择 push,且仅当 push 到 master 分支触发)
on:
push:
branches:
- master
# 任务列表
jobs:
# 任务名称
release:
# 在何种平台执行,可选 windows-latest/ubuntu-latest/macOS-latest 等
runs-on: ubuntu-latest
# 为了加速构建,我们使用同一个包含 Node.js 的容器运行所有命令
container:
image: thonatos/github-actions-nodejs
# 这里定义了任务运行过程中的各个步骤
steps:
# 代码拉取
- uses: actions/checkout@v1
with:
ref: master
# 依赖安装并打包
- name: Install Dependencies and Build
run: |
npm install -g npminstall
npminstall
npm run build
npm run build:lib
# NPM 包发布
- name: Release NPN Package
run: npm run semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}