fix(shelf): 修复清空/关闭暂存巢时的视觉卡顿 #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Release | |
| # 打包 DropNest.app 为 DMG 并发布到 GitHub Releases。 | |
| # | |
| # 触发条件: | |
| # 1. push tag v* → 构建并创建 Release | |
| # 2. 手动触发(Actions → Run workflow)→ 仅构建,上传 artifact | |
| # | |
| # 签名说明:CI 无开发者账号,使用 ad-hoc 签名(CODE_SIGN_IDENTITY="-")。 | |
| # 产出的 DMG 未做 Apple 公证,用户首次打开需手动去隔离属性(见 Release 说明)。 | |
| # 正式签名+公证版本请用本地开发者账号构建。 | |
| on: | |
| push: | |
| tags: ['v*'] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write # 创建 Release 需要 | |
| jobs: | |
| build: | |
| name: Build DMG | |
| runs-on: macos-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Show environment | |
| run: | | |
| xcodebuild -version | |
| swift --version | |
| - name: Build app (ad-hoc signed) | |
| run: | | |
| xcodebuild \ | |
| -project DropNest.xcodeproj \ | |
| -scheme DropNest \ | |
| -configuration Release \ | |
| -derivedDataPath build \ | |
| -destination 'generic/platform=macOS' \ | |
| build \ | |
| CODE_SIGN_IDENTITY="-" \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| CODE_SIGNING_ALLOWED=YES \ | |
| DEVELOPMENT_TEAM="" \ | |
| PROVISIONING_PROFILE_SPECIFIER="" | |
| - name: Locate .app bundle | |
| id: locate | |
| run: | | |
| APP_PATH="$(find build/Build/Products -name 'DropNest.app' -type d | head -1)" | |
| if [ -z "$APP_PATH" ]; then | |
| echo "::error::DropNest.app not found in build output" | |
| exit 1 | |
| fi | |
| echo "app_path=$APP_PATH" >> "$GITHUB_OUTPUT" | |
| echo "Found app at: $APP_PATH" | |
| - name: Re-sign entire app bundle (ad-hoc) | |
| # 预编译的 MediaRemoteAdapter.framework 自带原始签名与 Team ID, | |
| # 与主 App 的 ad-hoc 签名(无 Team ID)不匹配,dyld 加载时因 | |
| # Team ID 不一致直接终止进程(SIGABRT, Library missing)。 | |
| # CODE_SIGNING_REQUIRED=NO 导致 Xcode 的 CodeSignOnCopy 未重签名 framework。 | |
| # | |
| # 修复:codesign --deep 在新版 Xcode 已弃用且不可靠,改为: | |
| # 1. 对 app bundle 内所有 framework/dylib 显式移除旧签名 | |
| # 2. 对每个二进制单独 ad-hoc 重签 | |
| # 3. 最后对整个 app bundle 做 ad-hoc 签 | |
| # 4. 验证签名一致性 | |
| run: | | |
| set -e | |
| APP_PATH="${{ steps.locate.outputs.app_path }}" | |
| echo "=== Before re-sign ===" | |
| codesign -dvv "$APP_PATH/Contents/Frameworks/MediaRemoteAdapter.framework" 2>&1 || true | |
| echo "=== Removing old signatures ===" | |
| # 移除所有 framework 的签名 | |
| find "$APP_PATH/Contents/Frameworks" -name "*.framework" -type d | while read fw; do | |
| echo " Removing signature: $fw" | |
| codesign --remove-signature "$fw" 2>/dev/null || true | |
| done | |
| echo "=== Re-signing frameworks (ad-hoc) ===" | |
| # 对每个 framework 的可执行文件单独签名 | |
| find "$APP_PATH/Contents/Frameworks" -name "*.framework" -type d | while read fw; do | |
| echo " Ad-hoc signing: $fw" | |
| codesign --force --sign - "$fw" | |
| done | |
| echo "=== Re-signing entire app bundle (ad-hoc) ===" | |
| codesign --force --sign - "$APP_PATH" | |
| echo "=== Verify signatures ===" | |
| codesign --verify --deep --strict "$APP_PATH" 2>&1 && echo "App bundle signature OK" || echo "App bundle signature FAILED" | |
| codesign -dvv "$APP_PATH/Contents/Frameworks/MediaRemoteAdapter.framework" 2>&1 | |
| echo "=== Re-sign complete ===" | |
| - name: Setup Python for dmgbuild | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dmgbuild (hash-pinned) | |
| run: | | |
| python3 -m pip install --require-hashes -r Configuration/dmg/requirements.txt | |
| - name: Build DMG | |
| run: | | |
| chmod +x ./Configuration/dmg/create_dmg.sh | |
| ./Configuration/dmg/create_dmg.sh \ | |
| "${{ steps.locate.outputs.app_path }}" \ | |
| "build/DropNest.dmg" \ | |
| "DropNest" | |
| - name: Read version | |
| id: version | |
| run: | | |
| if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| VERSION="${GITHUB_REF#refs/tags/}" | |
| else | |
| VERSION="dev-$(date +%Y%m%d)-${GITHUB_SHA::7}" | |
| fi | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: DropNest-${{ steps.version.outputs.version }} | |
| path: build/DropNest.dmg | |
| retention-days: 30 | |
| if-no-files-found: error | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: build/DropNest.dmg | |
| name: DropNest ${{ github.ref_name }} | |
| body: | | |
| ## DropNest ${{ github.ref_name }} | |
| ### 安装步骤 | |
| 1. 下载 `DropNest.dmg` | |
| 2. 将 DropNest 拖入「应用程序」文件夹 | |
| 3. 首次打开:因未做 Apple 公证,需在终端执行: | |
| ```bash | |
| xattr -d com.apple.quarantine /Applications/DropNest.app | |
| ``` | |
| 或右键点击应用 →「打开」→ 确认。 | |
| > 本构建为 ad-hoc 签名(未公证)。正式签名版本请用 Apple Developer 账号本地构建。 | |
| ### 完整变更 | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true |