-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.55 KB
/
ci.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
name: ci
# 当推送到 main分支 时 触发此工作流
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@main
# 全局安装 pnpm
- name: install pnpm
run: npm install -g pnpm
# 使用 pnpm 安装依赖
- name: install dependencies
run: pnpm install
# 使用 pnpm 执行测试
- name: run tests
run: pnpm test:ci
# 上传覆盖率报告到 Coveralls
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@main
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# 使用 pnpm 构建
- name: build
run: pnpm build
# 自动发布
- name: Auto Release
run: npx cvlar -r
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 同步到 Gitee
- name: Sync to Gitee
uses: wearerequired/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }}
with:
source-repo: '[email protected]:kwooshung/Randoms.git'
destination-repo: '[email protected]:kwooshung/Randoms.git'
# 自动发布到 npm
- name: Sync to Npm.js
uses: actions/setup-node@main
with:
node-version: '14.0.0'
registry-url: https://registry.npmjs.org/
- name: Publish to Npm.js
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}