diff --git a/.github/workflows/build_macos_arm64.yml b/.github/workflows/build_macos_arm64.yml new file mode 100644 index 000000000..caf568bdd --- /dev/null +++ b/.github/workflows/build_macos_arm64.yml @@ -0,0 +1,72 @@ +name: Build macOS arm64 (No OCR) + +on: + push: + branches: [ "master" ] + paths: + - '.github/workflows/build_macos_arm64.yml' + - 'src/**' + - 'mac/**' + pull_request: + branches: [ "master" ] + paths: + - '.github/workflows/build_macos_arm64.yml' + - 'src/**' + - 'mac/**' + workflow_dispatch: + +jobs: + build: + name: Build macOS arm64 + runs-on: macos-26 + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Install Homebrew dependencies + run: | + brew trust --tap aws/tap || true + brew install pkg-config gpac dylibbundler + + - name: Set up Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Cache Cargo registry and build target + uses: actions/cache@v5 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + mac/rust + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Build CCExtractor (No OCR) + run: | + chmod +x build.command + ./build.command + working-directory: ./mac + + - name: Bundle dynamic libraries + run: | + dylibbundler -cd -b -x ./ccextractor -d ./libs -p @executable_path/libs/ + working-directory: ./mac + + - name: Verify compiled binary + run: | + file ./mac/ccextractor + otool -L ./mac/ccextractor + ./mac/ccextractor --version || true + + - name: Package binary and bundled libraries + run: | + zip -r ccextractor-macos-arm64.zip ccextractor libs + working-directory: ./mac + + - name: Upload CCExtractor binary + uses: actions/upload-artifact@v7 + with: + name: ccextractor-macos-arm64 + path: ./mac/ccextractor-macos-arm64.zip