From 9f33ac9f5f69dd8240343ef6debba8a92e215664 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Wed, 17 Jun 2026 13:24:34 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E9=AA=8C=E8=AF=81=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E7=BA=BF=E8=BE=93=E5=87=BA=E8=90=BD=E7=9B=98=E5=88=B0=E5=AE=BF?= =?UTF-8?q?=E4=B8=BB=E8=B7=AF=E5=BE=84=EF=BC=8C=E4=BE=BF=E4=BA=8E=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/verify-macos-signing.yml | 43 ++++++++++++++++------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/verify-macos-signing.yml b/.gitea/workflows/verify-macos-signing.yml index 91a354b..55e541a 100644 --- a/.gitea/workflows/verify-macos-signing.yml +++ b/.gitea/workflows/verify-macos-signing.yml @@ -1,5 +1,6 @@ # 临时验证 workflow —— 仅验证 macOS 签名+公证链路,不发版、不部署。 # 触发:push 到 verify-macos-signing 分支。验证通过后连同本文件与分支一并删除。 +# host 模式 runner 以本机用户身份运行,把验证输出写到固定宿主路径,便于本地读取结果。 name: Verify macOS Signing on: @@ -13,10 +14,16 @@ jobs: env: PUB_HOSTED_URL: https://pub.flutter-io.cn FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn + RESULT_FILE: /Users/wangjia/.cache/jiu-verify-result.txt steps: - uses: actions/checkout@v4 + - name: Reset result file + run: | + mkdir -p /Users/wangjia/.cache + echo "=== verify-macos-signing run @ $(date) ===" > "$RESULT_FILE" + - name: Provision (idempotent) run: sh scripts/ci/provision-mac.sh @@ -27,18 +34,28 @@ jobs: APPSTORE_API_KEY_ID: ${{ secrets.APPSTORE_API_KEY_ID }} APPSTORE_API_ISSUER_ID: ${{ secrets.APPSTORE_API_ISSUER_ID }} APPSTORE_API_KEY_P8_BASE64: ${{ secrets.APPSTORE_API_KEY_P8_BASE64 }} - run: sh scripts/ci/compile-macos.sh "client-v0.0.0" - - - name: Assert signed + notarized + stapled run: | - set -e + set -o pipefail + sh scripts/ci/compile-macos.sh "client-v0.0.0" 2>&1 | tee -a "$RESULT_FILE" + + - name: Assert + persist proof + if: always() + run: | APP="client/build/macos/Build/Products/Release/jiu_client.app" - echo "== codesign --verify ==" - codesign --verify --deep --strict --verbose=2 "$APP" - echo "== codesign -dvvv (Authority/TeamID) ==" - codesign -dvvv "$APP" 2>&1 | grep -E "Authority|TeamIdentifier|flags|Timestamp" || true - echo "== stapler validate ==" - xcrun stapler validate "$APP" - echo "== spctl assessment(必须 Notarized Developer ID)==" - spctl -a -vvv -t install "$APP" - echo "== OK: signed + notarized + stapled ==" + { + echo "" + echo "=== ASSERT @ $(date) ===" + if [ -d "$APP" ]; then + echo "-- codesign --verify --" + codesign --verify --deep --strict --verbose=2 "$APP" 2>&1 && echo "CODESIGN_VERIFY_OK" || echo "CODESIGN_VERIFY_FAILED" + echo "-- codesign -dvvv (Authority/Team/flags) --" + codesign -dvvv "$APP" 2>&1 | grep -E "Authority|TeamIdentifier|flags|Timestamp" || true + echo "-- stapler validate --" + xcrun stapler validate "$APP" 2>&1 && echo "STAPLE_OK" || echo "STAPLE_INVALID" + echo "-- spctl assessment --" + spctl -a -vvv -t install "$APP" 2>&1 && echo "SPCTL_ACCEPTED" || echo "SPCTL_REJECTED" + else + echo "APP_NOT_BUILT (compile/sign/notarize 步骤已失败,见上方日志)" + fi + echo "=== END @ $(date) ===" + } >> "$RESULT_FILE" 2>&1