From 66a479596ac8e8a302f2b510f43d251f88b42b62 Mon Sep 17 00:00:00 2001 From: Del Wang Date: Sun, 13 Apr 2025 11:29:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=20Github=20Actions?= =?UTF-8?q?=20=E5=9B=BA=E4=BB=B6=E6=9E=84=E5=BB=BA=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/LX06.yaml | 50 +++++++++++++++++++++++++++++++++++++ .github/workflows/OH2P.yaml | 50 +++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 .github/workflows/LX06.yaml create mode 100644 .github/workflows/OH2P.yaml diff --git a/.github/workflows/LX06.yaml b/.github/workflows/LX06.yaml new file mode 100644 index 0000000..3d86e71 --- /dev/null +++ b/.github/workflows/LX06.yaml @@ -0,0 +1,50 @@ +name: 小爱音箱 Pro(LX06) +on: + workflow_dispatch: + +jobs: + build: + name: 小爱音箱 Pro 固件更新 + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: 🚗 初始化 Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "npm" + cache-dependency-path: "**/package-lock.json" + - name: 🔥 构建固件 + id: build + env: + MI_USER: ${{ secrets.MI_USER }} + MI_PASSWORD: ${{ secrets.MI_PASS }} + MI_DEVICE: 小爱音箱Pro + SSH_PASSWORD: open-xiaoai + run: | + cd packages/client-patch + npm install + npm run build + MODEL=$(cat assets/.model) + VERSION=$(cat assets/.version) + TAG=${MODEL}_${VERSION} + FIRMWARE=$(basename $(ls \assets/*.bin 2>/dev/null | head -n 1) .bin) + cp assets/$FIRMWARE/root.squashfs assets/${TAG}.squashfs + cp assets/$FIRMWARE/root-patched.squashfs assets/${TAG}_patched.squashfs + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "tag=$TAG" >> $GITHUB_OUTPUT + - name: ✅ 发布固件 + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + token: ${{ secrets.GITHUB_TOKEN }} + name: 小爱音箱 Pro v${{ steps.build.outputs.version }} + tag: ${{ steps.build.outputs.tag }} + body: 小爱音箱 Pro v${{ steps.build.outputs.version }} 固件更新 + draft: true + prerelease: false + makeLatest: latest + removeArtifacts: true + artifacts: packages/client-patch/assets/*.squashfs \ No newline at end of file diff --git a/.github/workflows/OH2P.yaml b/.github/workflows/OH2P.yaml new file mode 100644 index 0000000..c51e7e6 --- /dev/null +++ b/.github/workflows/OH2P.yaml @@ -0,0 +1,50 @@ +name: Xiaomi 智能音箱 Pro(OH2P) +on: + workflow_dispatch: + +jobs: + build: + name: Xiaomi 智能音箱 Pro 固件更新 + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: 🚗 初始化 Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "npm" + cache-dependency-path: "**/package-lock.json" + - name: 🔥 构建固件 + id: build + env: + MI_USER: ${{ secrets.MI_USER }} + MI_PASSWORD: ${{ secrets.MI_PASS }} + MI_DEVICE: Xiaomi 智能音箱 Pro + SSH_PASSWORD: open-xiaoai + run: | + cd packages/client-patch + npm install + npm run build + MODEL=$(cat assets/.model) + VERSION=$(cat assets/.version) + TAG=${MODEL}_${VERSION} + FIRMWARE=$(basename $(ls \assets/*.bin 2>/dev/null | head -n 1) .bin) + cp assets/$FIRMWARE/root.squashfs assets/${TAG}.squashfs + cp assets/$FIRMWARE/root-patched.squashfs assets/${TAG}_patched.squashfs + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "tag=$TAG" >> $GITHUB_OUTPUT + - name: ✅ 发布固件 + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + token: ${{ secrets.GITHUB_TOKEN }} + name: Xiaomi 智能音箱 Pro v${{ steps.build.outputs.version }} + tag: ${{ steps.build.outputs.tag }} + body: Xiaomi 智能音箱 Pro v${{ steps.build.outputs.version }} 固件更新 + draft: true + prerelease: false + makeLatest: latest + removeArtifacts: true + artifacts: packages/client-patch/assets/*.squashfs \ No newline at end of file