Skip to content

Commit 8f2c6b4

Browse files
committed
update build
1 parent 257d803 commit 8f2c6b4

1 file changed

Lines changed: 33 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,39 @@ jobs:
2222
- name: Build and Package
2323
run: npm run release
2424

25-
- name: Upload Chrome Artifact
26-
uses: actions/upload-artifact@v4
27-
with:
28-
name: web-clipper-chrome
29-
path: release/web-clipper-chrome.zip
25+
# 4. 打包 Chrome 版本
26+
# 进入 dist/chrome 目录进行压缩
27+
- name: Package Chrome Extension
28+
run: |
29+
if [ -d "dist/chrome" ]; then
30+
cd dist/chrome
31+
zip -r ../../web-clipper-chrome.zip ./*
32+
echo "✅ Chrome version packaged."
33+
else
34+
echo "❌ Error: dist/chrome folder not found!"
35+
exit 1
36+
fi
3037
31-
- name: Upload Firefox Artifact
38+
# 5. 打包 Firefox 版本
39+
# 进入 dist 根目录压缩,但【排除】chrome 子文件夹
40+
# 这样 Firefox 包里就不会包含另一个 Chrome 包的数据
41+
- name: Package Firefox Extension
42+
run: |
43+
if [ -f "dist/manifest.json" ]; then
44+
cd dist
45+
zip -r ../web-clipper-firefox.zip
46+
echo "✅ Firefox version packaged (from dist root)."
47+
else
48+
echo "❌ Error: dist/manifest.json not found!"
49+
exit 1
50+
fi
51+
52+
# 6. 上传两个 ZIP 文件
53+
- name: Upload Artifacts
3254
uses: actions/upload-artifact@v4
3355
with:
34-
name: web-clipper-firefox
35-
path: release/web-clipper-firefox.zip
36-
56+
name: web-clipper-release
57+
path: |
58+
web-clipper-chrome.zip
59+
web-clipper-firefox.zip
60+
retention-days: 5

0 commit comments

Comments
 (0)