name: Deploy Client # Mirrors ~/code/jiu/.gitea/workflows/deploy-client.yml's tag→build→release→ # deploy shape, trimmed to the two platforms drafted so far (Android + # Windows — no client-web/macOS/iOS jobs; pangolin has no Flutter-web build # in this pipeline and macOS/iOS are a separate not-yet-drafted phase, see # docs/superpowers/plans/2026-07-05-cicd.md Phase 3). # # TODO(controller) — RUNNER AVAILABILITY: per docs/ci-runner.md, pangolin # currently has exactly ONE registered Gitea Actions runner # ("mac-pangolin-2", label `nas:host`). Neither `runs-on: mac` nor # `runs-on: windows` below has any runner registered to pick it up yet — this # workflow will queue forever until that's fixed. Options: (a) register # mac-pangolin-2 with an additional `mac` label (it's already a mac host — # cheapest fix for build-android/release-deploy) and separately stand up + # register an actual Windows host runner labeled `windows` for build-windows # (no such machine exists per docs/ci-runner.md), or (b) repoint both at # `nas` and accept that Android/Windows builds then compete with the # docker-in-domain nas jobs on the same single mac host. This mirrors the # `runs-on: mac` / `runs-on: windows` split already planned in # docs/superpowers/plans/2026-07-05-cicd.md Task 7/10 — written that way here # for fidelity to that plan, NOT because the runners are confirmed to exist. on: push: tags: - 'client-v[0-9]*.[0-9]*.[0-9]*' workflow_dispatch: concurrency: group: deploy-client cancel-in-progress: false jobs: build-android: runs-on: mac env: GOPROXY: https://goproxy.cn,direct PUB_HOSTED_URL: https://pub.flutter-io.cn FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn steps: - name: Checkout uses: actions/checkout@v4 - name: Compile (Android APK) env: RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }} KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} REF_NAME: ${{ gitea.ref_name }} run: bash scripts/ci/compile-android.sh "$REF_NAME" - name: Upload android artifact uses: actions/upload-artifact@v3 with: name: android path: dist/ build-windows: runs-on: windows env: GOPROXY: https://goproxy.cn,direct PUB_HOSTED_URL: https://pub.flutter-io.cn FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn steps: - name: Checkout uses: actions/checkout@v4 - name: Compile (Windows installer) shell: bash env: REF_NAME: ${{ gitea.ref_name }} run: bash scripts/ci/compile-windows.sh "$REF_NAME" - name: Upload windows artifact uses: actions/upload-artifact@v3 with: name: windows path: dist/ release-deploy: needs: [build-android, build-windows] runs-on: mac steps: - name: Checkout uses: actions/checkout@v4 # 一次性下所有 artifact(不带 name),避免同 job 内两次复用 download-artifact # action → act 对其只读缓存 git 仓库做二次操作时 EACCES(pack idx 444)。 - name: Download all artifacts uses: actions/download-artifact@v3 with: path: dist-raw/ - name: Flatten artifacts into dist/ shell: bash run: | mkdir -p dist find dist-raw -type f -exec cp {} dist/ \; echo "dist/ 内容:"; ls -la dist/ - name: Release → Forgejo env: FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} FORGEJO_URL: ${{ secrets.FORGEJO_URL }} REF_NAME: ${{ gitea.ref_name }} run: bash scripts/ci/release-client.sh "$REF_NAME" - name: Deploy → pangolin1 (downloads/) env: DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} REF_NAME: ${{ gitea.ref_name }} run: bash scripts/ci/deploy-client.sh "$REF_NAME" - name: Notify if: always() env: TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} REF_NAME: ${{ gitea.ref_name }} JOB_STATUS: ${{ job.status }} run: | . scripts/ci/notify.sh if [ "$JOB_STATUS" = "success" ]; then notify_ok "client $REF_NAME released + deployed" else notify_fail "client $REF_NAME pipeline failed" fi