test: 尝试修复打不开文件的问题 #49
This file contains 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: Publish CLI Package | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish-cli: | |
if: contains(github.event.head_commit.message, 'Publish npm') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# 设置 Node.js 环境 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
registry-url: 'https://registry.npmjs.org' | |
# 安装 pnpm | |
- name: Install pnpm | |
run: npm install -g pnpm | |
# 安装依赖 | |
- name: Install Dependencies | |
run: pnpm install | |
working-directory: ./packages/cli | |
# 构建(如果需要) | |
- name: Build package | |
run: pnpm run build | |
working-directory: ./packages/cli | |
# 发布到 npm | |
- name: Publish to npm | |
run: pnpm publish --access public | |
working-directory: ./packages/cli | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} |