diff --git a/.github/workflows/build-darwin.yml b/.github/workflows/build-darwin.yml new file mode 100644 index 0000000..1a974f0 --- /dev/null +++ b/.github/workflows/build-darwin.yml @@ -0,0 +1,57 @@ +name: Build macOS Binaries + +on: + workflow_dispatch: + +jobs: + build: + name: Build macOS binaries + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4.2.2 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-apple-darwin,x86_64-apple-darwin + + - name: Install dependencies + run: | + brew update + brew install openssl@3 protobuf pkg-config node + + - name: Build x86_64 binary + run: | + RUSTFLAGS="-C link-arg=-s -C target-cpu=x86-64-v3" \ + cargo build --release --target x86_64-apple-darwin + + - name: Build arm64 binary + run: | + RUSTFLAGS="-C link-arg=-s -C target-cpu=apple-m1" \ + cargo build --release --target aarch64-apple-darwin + + - name: Create universal binary + run: | + lipo -create \ + target/x86_64-apple-darwin/release/cursor-api \ + target/aarch64-apple-darwin/release/cursor-api \ + -output target/cursor-api-universal + + - name: Upload x86_64 artifact + uses: actions/upload-artifact@v4.6.0 + with: + name: cursor-api-x86_64-apple-darwin + path: target/x86_64-apple-darwin/release/cursor-api + + - name: Upload arm64 artifact + uses: actions/upload-artifact@v4.6.0 + with: + name: cursor-api-aarch64-apple-darwin + path: target/aarch64-apple-darwin/release/cursor-api + + - name: Upload universal artifact + uses: actions/upload-artifact@v4.6.0 + with: + name: cursor-api-universal-apple-darwin + path: target/cursor-api-universal diff --git a/Dockerfile.cross b/Dockerfile.cross index 902da8b..d93a731 100644 --- a/Dockerfile.cross +++ b/Dockerfile.cross @@ -11,6 +11,7 @@ RUN apt-get update && \ pkg-config \ libssl-dev \ protobuf-compiler \ + openssl \ && rm -rf /var/lib/apt/lists/* # 设置环境变量 (如果需要) diff --git a/Dockerfile.cross.arm64 b/Dockerfile.cross.arm64 index 713e1f3..6ec6d19 100644 --- a/Dockerfile.cross.arm64 +++ b/Dockerfile.cross.arm64 @@ -11,6 +11,7 @@ RUN apt-get update && \ pkg-config \ libssl-dev \ protobuf-compiler \ + openssl \ && rm -rf /var/lib/apt/lists/* # 设置环境变量 (如果需要)