소스 검색

ci: 移除 main 上的 release warmup

GitHub Actions cache 时效短且易被挤掉,push main 全量编三台
release 不划算。正式包只在打 v* tag 时编译。

Co-authored-by: Cursor <cursoragent@cursor.com>
darknessomi 1 개월 전
부모
커밋
8f8e069f00
3개의 변경된 파일과 5개의 추가작업 그리고 173개의 파일을 삭제
  1. 5 10
      .agents/skills/qmai-release/SKILL.md
  2. 0 59
      .github/workflows/build.yml
  3. 0 104
      .github/workflows/ci.yml

+ 5 - 10
.agents/skills/qmai-release/SKILL.md

@@ -1,6 +1,6 @@
 ---
 name: qmai-release
-description: Release a stable QMAI version by updating version metadata and changelog, pushing main, waiting for the same-commit main CI release-cache warmup, then creating and pushing an annotated version tag. Use when asked to bump, publish, or tag a QMAI stable release; do not use for prerelease builds or ordinary PR delivery.
+description: Release a stable QMAI version by updating version metadata and changelog, pushing main, then creating and pushing an annotated version tag. Use when asked to bump, publish, or tag a QMAI stable release; do not use for prerelease builds or ordinary PR delivery.
 ---
 
 # QMAI Stable Release
@@ -10,8 +10,8 @@ Use this workflow only in the `Mochocyang/QMAI` repository. Preserve the user's
 ## Release invariants
 
 - Push the release commit to `main` by itself. Never push `main` and the version tag in one command or atomic push.
-- Wait for the `CI` workflow on the exact release commit to finish successfully before creating the tag. This allows the Linux, Windows, and macOS release-cache warmup to complete.
-- Never create the tag while required validation or the matching main CI run is failing, cancelled, missing, or still running.
+- Do not wait for main CI before tagging. Main CI does not compile release binaries; only the tag workflow does.
+- Never create the tag while local required validation is failing.
 - Never overwrite, move, or force-push `main` or a release tag.
 - Stop if `origin/main` moves away from the release commit before tagging. Reconcile the new remote state instead of tagging an older commit.
 - Use an annotated tag named `v<package-version>` and verify that the remote tag resolves to the release commit.
@@ -46,18 +46,13 @@ Use this workflow only in the `Mochocyang/QMAI` repository. Preserve the user's
    - Re-fetch `origin/main` immediately before pushing and confirm it is the release commit's parent.
    - Push only `main`. Record the exact release commit SHA.
 
-5. Wait for cache warmup on the exact release SHA.
-   - Find the `CI` workflow run whose event is `push`, branch is `main`, and head SHA equals the release SHA.
-   - Wait with `gh run watch <run-id> --repo Mochocyang/QMAI --exit-status`.
-   - Stop if no matching run appears within 5 minutes, the run does not complete within 90 minutes, or its conclusion is not `success`.
-
-6. Tag only after CI succeeds.
+5. Tag after `main` is on the release commit.
    - Fetch `origin/main` and tags again.
    - Require local `HEAD`, `origin/main`, and the recorded release SHA to match.
    - Reconfirm that `v<version>` does not exist.
    - Create an annotated tag on the recorded SHA, then push only that tag in a separate command.
 
-7. Verify delivery.
+6. Verify delivery.
    - Verify remote `main` and the dereferenced remote tag both resolve to the recorded release SHA.
    - Confirm `QMAI Multi-Platform Release` started for that tag and SHA.
    - Report the release workflow URL and current status. Do not claim release completion while jobs or required assets are pending.

+ 0 - 59
.github/workflows/build.yml

@@ -10,67 +10,8 @@ permissions:
   contents: write
 
 jobs:
-  wait-for-main-ci:
-    name: Wait for main release cache
-    runs-on: ubuntu-22.04
-    timeout-minutes: 90
-    steps:
-      - name: Require successful CI for this commit
-        env:
-          GH_TOKEN: ${{ github.token }}
-          RELEASE_SHA: ${{ github.sha }}
-          REPOSITORY: ${{ github.repository }}
-        shell: bash
-        run: |
-          set -euo pipefail
-
-          missing_deadline=$((SECONDS + 300))
-          completion_deadline=$((SECONDS + 5400))
-
-          while (( SECONDS < completion_deadline )); do
-            run_row="$(
-              gh api -X GET \
-                -H "Accept: application/vnd.github+json" \
-                -H "X-GitHub-Api-Version: 2026-03-10" \
-                "repos/${REPOSITORY}/actions/workflows/ci.yml/runs" \
-                -f event=push \
-                -f branch=main \
-                -f head_sha="${RELEASE_SHA}" \
-                -f per_page=20 \
-                --jq '((.workflow_runs | sort_by(.created_at) | last) // empty) | [.id, .status, (.conclusion // ""), .html_url] | @tsv'
-            )"
-
-            if [[ -z "${run_row}" ]]; then
-              if (( SECONDS >= missing_deadline )); then
-                echo "::error::No main CI push run found for ${RELEASE_SHA}; push main and wait for CI before tagging"
-                exit 1
-              fi
-              echo "Waiting for the main CI run for ${RELEASE_SHA} to appear..."
-              sleep 15
-              continue
-            fi
-
-            IFS=$'\t' read -r run_id run_status run_conclusion run_url <<< "${run_row}"
-            echo "Main CI ${run_id}: ${run_status}${run_conclusion:+/${run_conclusion}} (${run_url})"
-
-            if [[ "${run_status}" == "completed" ]]; then
-              if [[ "${run_conclusion}" == "success" ]]; then
-                echo "Main CI completed successfully; release cache is ready"
-                exit 0
-              fi
-              echo "::error::Main CI ${run_id} concluded ${run_conclusion}; refusing to build the release"
-              exit 1
-            fi
-
-            sleep 15
-          done
-
-          echo "::error::Timed out waiting for main CI for ${RELEASE_SHA}"
-          exit 1
-
   build-release:
     name: Build ${{ matrix.display_label }}
-    needs: wait-for-main-ci
     if: github.event_name == 'push'
     runs-on: ${{ matrix.runner }}
     env:

+ 0 - 104
.github/workflows/ci.yml

@@ -98,107 +98,3 @@ jobs:
       - name: Check Rust build
         working-directory: src-tauri
         run: cargo build
-
-  # Warm target/release on the default branch so tag builds can restore it.
-  # Only when src-tauri changes (or manual dispatch). Frontend merges must not
-  # pay for a 3-platform release compile.
-  release-compile:
-    name: Release compile ${{ matrix.display }}
-    needs: changes
-    if: github.event_name != 'pull_request' && needs.changes.outputs.rust == 'true'
-    runs-on: ${{ matrix.platform }}
-    env:
-      MACOSX_DEPLOYMENT_TARGET: "13.0"
-    strategy:
-      fail-fast: false
-      matrix:
-        include:
-          - platform: ubuntu-22.04
-            display: Linux x64
-            # x86_64 / amd64 only. Do not add i686 or aarch64 Linux targets.
-          - platform: macos-latest
-            display: macOS
-
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v5
-
-      - name: Install Rust stable
-        uses: dtolnay/rust-toolchain@stable
-
-      - name: Install protoc (macOS)
-        if: matrix.platform == 'macos-latest'
-        run: |
-          brew untap aws/tap || true
-          brew install protobuf
-
-      - name: Install dependencies (Ubuntu)
-        if: matrix.platform == 'ubuntu-22.04'
-        run: |
-          sudo apt-get update
-          sudo apt-get install -y curl libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf protobuf-compiler
-
-      - name: Rust cache
-        uses: Swatinem/rust-cache@v2
-        with:
-          workspaces: src-tauri
-          shared-key: qmai-release
-          add-job-id-key: false
-          cache-on-failure: true
-
-      - name: Setup Node.js
-        uses: actions/setup-node@v5
-        with:
-          node-version: 24
-          cache: npm
-
-      - name: Install frontend dependencies
-        run: npm ci
-
-      - name: Build frontend
-        run: npx vite build
-
-      - name: Cargo release build
-        working-directory: src-tauri
-        run: cargo build --release
-
-  release-compile-windows:
-    name: Release compile Windows x64
-    needs: changes
-    if: github.event_name != 'pull_request' && needs.changes.outputs.rust == 'true'
-    runs-on: windows-latest
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v5
-
-      - name: Install Rust stable
-        uses: dtolnay/rust-toolchain@stable
-
-      - name: Install protoc (Windows)
-        uses: arduino/setup-protoc@v3
-        with:
-          repo-token: ${{ secrets.GITHUB_TOKEN }}
-
-      - name: Rust cache
-        uses: Swatinem/rust-cache@v2
-        with:
-          workspaces: src-tauri
-          shared-key: qmai-release
-          add-job-id-key: false
-          cache-on-failure: true
-
-      - name: Setup Node.js
-        uses: actions/setup-node@v5
-        with:
-          node-version: 24
-          cache: npm
-
-      - name: Install frontend dependencies
-        run: npm ci
-
-      - name: Build frontend
-        run: npx vite build
-
-      - name: Cargo release build
-        working-directory: src-tauri
-        run: cargo build --release