Skip to content

Commit bb92471

Browse files
committed
feat(GitHub Actions): 在发布工作流中新增准备 README 的步骤
- 在发布工作流中添加了准备 README.md 的步骤,调整图片路径以确保在包目录中正确显示,提升文档的可用性和准确性。
1 parent b421590 commit bb92471

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ jobs:
3131
- name: Build project
3232
run: pnpm build:lib
3333

34+
- name: Prepare README for package
35+
run: |
36+
# 读取根目录的 README.md 内容
37+
README_CONTENT=$(cat README.md)
38+
# 调整图片路径,使其在包目录中正确显示
39+
MODIFIED_README=$(echo "$README_CONTENT" | sed 's|!\\[preview\\](/doc/img/preview.png)|!\\[preview\\](../../doc/img/preview.png)|g')
40+
# 确保包目录存在 (通常在 build 步骤后已存在)
41+
mkdir -p packages/simple-notation
42+
# 将修改后的 README 写入包目录
43+
echo "$MODIFIED_README" > packages/simple-notation/README.md
44+
3445
- name: Publish to npmjs
3546
run: |
3647
cd packages/simple-notation

0 commit comments

Comments
 (0)