docs(README): 补充 sync/get-config/set-config 的文档 #42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release new version | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
publish-npm: | |
runs-on: ubuntu-latest | |
steps: | |
# checkout 代码 | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # 获取完整历史 | |
clean: true # 清理工作目录 | |
# 准备 node | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
# 准备 pnpm | |
- uses: pnpm/action-setup@v4 | |
with: | |
cache: pnpm | |
# 配置 git 用户 | |
- name: Setup git user | |
run: | | |
git config --global user.email ${{secrets.USER_EMAIL}} | |
git config --global user.name ${{secrets.USER_NAME}} | |
# 安装依赖 | |
- name: Install dependencies | |
run: pnpm install | |
# 构建产物 | |
- name: Build | |
run: pnpm build | |
# 强制同步远程 git 标签(消除远程已删除的 tag 缓存对 Lerna 计算 commit 的影响) | |
- name: Sync git tags | |
run: | | |
git fetch --prune --prune-tags # 清理已删除的远程标签 | |
git fetch --tags -f # 强制更新所有标签 | |
# Lerna 发布 | |
- name: Publish with Lerna | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.npm_token}} | |
GH_TOKEN: ${{secrets.COMMIT_TOKEN}} | |
run: | | |
pnpm ci:version | |
pnpm ci:publish |