Skip to content

Commit d04726d

Browse files
authored
ci: fix publish workflow, using actions/upload-artifact@v4 will ingore .xx files (#173)
1 parent 062fa4d commit d04726d

2 files changed

Lines changed: 2 additions & 49 deletions

File tree

.github/workflows/auto-publish.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,6 @@ jobs:
5151
find template -type d -name node_modules -prune -exec rm -rf {} +
5252
# 生成待发布 tarball(验证用)
5353
npm pack --dry-run
54-
- name: Upload build artifact
55-
uses: actions/upload-artifact@v4
56-
with:
57-
name: dist-artifact
58-
path: ./
59-
# Publish job
60-
publish:
61-
needs: build
62-
runs-on: ubuntu-latest
63-
steps:
64-
- uses: actions/setup-node@v4
65-
with:
66-
node-version: 20
67-
registry-url: https://registry.npmjs.org
68-
- name: Download build artifact
69-
uses: actions/download-artifact@v4
70-
with:
71-
name: dist-artifact
72-
path: ./
7354
- name: Parse Publish tag
7455
id: parse_tag
7556
run: |

.github/workflows/dispatch-publish.yml

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,50 +23,41 @@ concurrency:
2323
group: ${{ github.workflow }}-${{ github.sha }}
2424
cancel-in-progress: true
2525

26-
# 定义工作流中的作业
2726
jobs:
2827
build:
29-
# 指定运行环境为最新版本的ubuntu
3028
runs-on: ubuntu-latest
3129
outputs:
3230
version: ${{ steps.ver.outputs.value }}
3331
steps:
34-
# 步骤1: 检出代码
3532
- name: CheckOut Code
3633
uses: actions/checkout@v4
3734
with:
3835
ref: ${{ github.ref_name }}
3936

40-
# 步骤2: 设置pnpm包管理器
4137
- name: Setup pnpm
4238
uses: pnpm/action-setup@v4
4339
with:
4440
version: 9
4541

46-
# 步骤3: 设置Node.js环境
4742
- name: Setup Node
4843
uses: actions/setup-node@v4
4944
with:
50-
node-version: 20 # 使用Node.js 20版本
51-
registry-url: "https://registry.npmjs.org" # 设置npm registry地址
45+
node-version: 20
46+
registry-url: "https://registry.npmjs.org"
5247

53-
# 步骤4: 获取pnpm缓存目录路径
5448
- name: Get pnpm store directory
5549
id: pnpm-cache
5650
run: |
5751
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
5852
59-
# 步骤5: 配置pnpm缓存
6053
- uses: actions/cache@v3
6154
name: Setup pnpm cache
6255
with:
6356
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
64-
# 使用操作系统类型和pnpm-lock.yaml的哈希值作为缓存键
6557
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
6658
restore-keys: |
6759
${{ runner.os }}-pnpm-store-
6860
69-
# 步骤6: 安装项目依赖
7061
- name: Install dependencies
7162
run: pnpm i --no-frozen-lockfile
7263
- name: Get version
@@ -96,25 +87,6 @@ jobs:
9687
find template -type d -name node_modules -prune -exec rm -rf {} +
9788
# 生成待发布 tarball(验证用)
9889
npm pack --dry-run
99-
- name: Upload build artifact
100-
uses: actions/upload-artifact@v4
101-
with:
102-
name: dist-artifact
103-
path: ./
104-
# Publish job
105-
publish:
106-
needs: build
107-
runs-on: ubuntu-latest
108-
steps:
109-
- uses: actions/setup-node@v4
110-
with:
111-
node-version: 20
112-
registry-url: https://registry.npmjs.org
113-
- name: Download build artifact
114-
uses: actions/download-artifact@v4
115-
with:
116-
name: dist-artifact
117-
path: ./
11890
- name: Show version and tag
11991
run: |
12092
echo "publish version: ${{ needs.build.outputs.version }}"

0 commit comments

Comments
 (0)