fix: update artifact naming and improve zip compression step in workflow
Some checks failed
构建扩展程序 / 构建扩展程序 (push) Successful in 49s
构建扩展程序 / 发布至 Chrome 应用商店 (push) Failing after 28s

This commit is contained in:
Astrian Zheng 2025-05-28 21:23:18 +10:00
parent bfd68e1faa
commit c7553ace12
Signed by: Astrian
SSH Key Fingerprint: SHA256:rVnhx3DAKjujCwWE13aDl7uV6+9U1MvydLkNRXJrBiA

View File

@ -26,16 +26,17 @@ jobs:
- name: 构建扩展程序 - name: 构建扩展程序
run: npm run build run: npm run build
- name: 工件压缩成 ZIP - name: 构建结果压缩成 ZIP
run: |- run: |-
mkdir -p dist cd dist
zip -r artifact-${{ gitea.sha }}.zip dist/* zip -r ../extension-${{ gitea.sha }}.zip ./*
cd ..
- name: 上传工件 - name: 上传构建工件
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: artifact-${{ gitea.sha }} name: extension-${{ gitea.sha }}
path: artifact-${{ gitea.sha }}.zip path: extension-${{ gitea.sha }}.zip
publish: publish:
name: 发布至 Chrome 应用商店 name: 发布至 Chrome 应用商店
@ -47,18 +48,22 @@ jobs:
- name: 下载构建工件 - name: 下载构建工件
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: artifact-${{ gitea.sha }} name: extension-${{ gitea.sha }}
- uses: actions/setup-node@v2-beta - name: 设置 Node.js
name: 设置 Node.js uses: actions/setup-node@v3
with: with:
node-version: "22" node-version: "22"
- name: 安装提交器 - name: 安装 Chrome Web Store 上传工具
run: |- run: |-
npm install -g chrome-webstore-upload-cli npm install -g chrome-webstore-upload-cli
- name: 上传扩展程序 - name: 上传扩展程序到 Chrome Web Store
run: |- run: |-
chrome-webstore-upload upload --source artifact-${{ gitea.sha }}.zip --extension-id kphoaomopljjiofeaigjmbagmbdaamhh --client-id ${{ secrets.CI_GOOGLE_CLIENT_ID }} --client-secret ${{ secrets.CI_GOOGLE_CLIENT_SECRET }} --refresh-token ${{ secrets.CI_GOOGLE_REFRESH_TOKEN }} chrome-webstore-upload upload \
--source extension-${{ gitea.sha }}.zip \
--extension-id kphoaomopljjiofeaigjmbagmbdaamhh \
--client-id ${{ secrets.CI_GOOGLE_CLIENT_ID }} \
--client-secret ${{ secrets.CI_GOOGLE_CLIENT_SECRET }} \
--refresh-token ${{ secrets.CI_GOOGLE_REFRESH_TOKEN }}