Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Github Actions): 修复release发布异常,支持自动发布npm包 #45

Merged
merged 6 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/CD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20.12.2
# 淘宝镜像加速
registry-url: 'https://registry.npmmirror.com'
# 缓存
cache: pnpm

# 下载依赖,并执行初始化脚本:钩子函数、思维导图构建
# 基于国内镜像源下载依赖,并执行初始化脚本:钩子函数、思维导图构建
- name: Install Dependencies
run: |
./scripts/ci
Expand Down Expand Up @@ -92,8 +90,8 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20.12.2
# 淘宝镜像加速
registry-url: 'https://registry.npmmirror.com'
# npm包上传地址,用于注册,参考:https://github.com/actions/setup-node
registry-url: 'https://registry.npmjs.org'
# 缓存
cache: pnpm

Expand All @@ -111,7 +109,7 @@ jobs:
run: |
pnpm publish -r --filter "./packages/**"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

# 构建并部署Dist
deploy-dist:
Expand Down Expand Up @@ -141,7 +139,6 @@ jobs:
with:
node-version: 20.12.2
cache: pnpm
registry-url: https://registry.npmmirror.com

- name: Setup Pages
uses: actions/configure-pages@v4
Expand All @@ -154,6 +151,7 @@ jobs:
- name: Build with VitePress
run: pnpm build:docs

# 上传dist文件
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20.12.2
# 淘宝镜像加速
registry-url: 'https://registry.npmmirror.com'
# 缓存
cache: pnpm

Expand Down
Loading