Skip to content

Commit 42b32fc

Browse files
committed
feat: add Python setup and replace cos-action with coscmd for improved error handling in Tencent CI workflow
1 parent 599068f commit 42b32fc

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

.github/workflows/tencent.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ jobs:
2020
with:
2121
node-version: "22.x"
2222

23+
- name: Setup Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.11"
27+
2328
- name: Build project
2429
run: npm i -g pnpm && pnpm install && pnpm build
2530

@@ -29,15 +34,16 @@ jobs:
2934
ls -la dist/
3035
echo "Total files: $(find dist -type f | wc -l)"
3136
37+
# 使用 coscmd 替代 cos-action,可输出更清晰的错误信息
3238
# BUCKET 格式需为 bucketname-appid,如 mysite-1234567890
33-
# 确保 GitHub Secrets 中 SECRET_ID、SECRET_KEY、BUCKET 已正确配置
39+
- name: Setup coscmd
40+
run: pip install coscmd
41+
42+
- name: Configure coscmd
43+
run: |
44+
coscmd config -a ${{ secrets.SECRET_ID }} -s ${{ secrets.SECRET_KEY }} \
45+
-b ${{ secrets.BUCKET }} -r ap-shanghai
46+
3447
- name: Upload COS
35-
uses: TencentCloud/cos-action@v1
36-
with:
37-
secret_id: ${{ secrets.SECRET_ID }}
38-
secret_key: ${{ secrets.SECRET_KEY }}
39-
cos_bucket: ${{ secrets.BUCKET }}
40-
cos_region: ap-shanghai
41-
local_path: dist
42-
remote_path: /
43-
clean: true
48+
run: |
49+
coscmd upload -rfs --delete dist/ /

0 commit comments

Comments
 (0)