msr-mod/.gitea/workflows/workflow.yaml
Astrian Zheng 9dcb1c0411
Some checks failed
构建扩展程序 / 构建扩展程序 (push) Successful in 1m3s
构建扩展程序 / 发布至 Chrome 应用商店 (push) Failing after 32s
fix: remove unused extension ID parameter from Chrome Web Store upload step
2025-05-28 15:33:52 +10:00

68 lines
1.5 KiB
YAML

name: 构建扩展程序
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: 构建扩展程序
runs-on: ubuntu-latest
env:
EXTENSION_ID: kphoaomopljjiofeaigjmbagmbdaamhh
steps:
- uses: actions/checkout@v3
name: 检出代码
- name: 设置 Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: 安装依赖
run: npm install
- name: 构建扩展程序
run: npm run build
- name: 上传工件
uses: actions/upload-artifact@v3
with:
name: artifact-${{ gitea.sha }}
path: dist/
publish:
name: 发布至 Chrome 应用商店
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
name: 检出代码
- name: 下载构建工件
uses: actions/download-artifact@v3
with:
name: artifact-${{ gitea.sha }}
- uses: actions/setup-node@v2-beta
name: 设置 Node.js
with:
node-version: "16.10"
- name: 安装提交器
run: |-
npm install -g chrome-webstore-upload-cli
- name: 上传扩展程序
run: |-
chrome-webstore-upload upload \\
--source artifact-${{ gitea.sha }}.zip \\
--client-id ${{ secrets.CI_GOOGLE_CLIENT_ID }} \\
--client-secret ${{ secrets.CI_GOOGLE_CLIENT_SECRET }} \\
--refresh-token ${{ secrets.CI_GOOGLE_REFRESH_TOKEN }}