diff --git a/.github/workflows/LX06.yaml b/.github/workflows/LX06.yaml index c174c90..0f85cff 100644 --- a/.github/workflows/LX06.yaml +++ b/.github/workflows/LX06.yaml @@ -1,6 +1,11 @@ name: 小爱音箱 Pro(LX06) on: workflow_dispatch: + inputs: + ota: + description: " 请输入 OTA 版本信息" + type: string + required: true jobs: build: @@ -19,9 +24,7 @@ jobs: - name: 🔥 构建固件 id: build env: - MI_USER: ${{ secrets.MI_USER }} - MI_PASS: ${{ secrets.MI_PASS }} - MI_DEVICE: 小爱音箱Pro + OTA: ${{ inputs.ota }} SSH_PASSWORD: open-xiaoai run: | cd packages/client-patch diff --git a/.github/workflows/OH2P.yaml b/.github/workflows/OH2P.yaml index aabc7d7..5c65335 100644 --- a/.github/workflows/OH2P.yaml +++ b/.github/workflows/OH2P.yaml @@ -1,6 +1,11 @@ name: Xiaomi 智能音箱 Pro(OH2P) on: workflow_dispatch: + inputs: + ota: + description: " 请输入 OTA 版本信息" + type: string + required: true jobs: build: @@ -19,9 +24,7 @@ jobs: - name: 🔥 构建固件 id: build env: - MI_USER: ${{ secrets.MI_USER }} - MI_PASS: ${{ secrets.MI_PASS }} - MI_DEVICE: Xiaomi 智能音箱 Pro + OTA: ${{ inputs.ota }} SSH_PASSWORD: open-xiaoai run: | cd packages/client-patch diff --git a/packages/client-patch/src/ota.ts b/packages/client-patch/src/ota.ts index bd2e50a..488edf6 100644 --- a/packages/client-patch/src/ota.ts +++ b/packages/client-patch/src/ota.ts @@ -82,8 +82,13 @@ async function getOTA(channel: "release" | "current" | "stable" = "release") { async function main() { console.log(`🔥 正在获取设备信息...`); - const ota = await getOTA(); - if (!ota) { + let ota: any = {}; + if (process.env.OTA) { + ota = JSON.parse(process.env.OTA); + } else { + ota = await getOTA(); + } + if (!ota.url) { console.log(`❌ 获取设备信息失败`); process.exit(1); }