Skip to content

Merge pull request #6 from kwooshung/develop #6

Merge pull request #6 from kwooshung/develop

Merge pull request #6 from kwooshung/develop #6

Workflow file for this run

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}}