mirror of
https://github.com/wisdgod/cursor-api.git
synced 2025-11-03 03:13:41 +08:00
添加 build macOS 工作流
This commit is contained in:
57
.github/workflows/build-darwin.yml
vendored
Normal file
57
.github/workflows/build-darwin.yml
vendored
Normal file
@@ -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
|
||||
@@ -11,6 +11,7 @@ RUN apt-get update && \
|
||||
pkg-config \
|
||||
libssl-dev \
|
||||
protobuf-compiler \
|
||||
openssl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 设置环境变量 (如果需要)
|
||||
|
||||
@@ -11,6 +11,7 @@ RUN apt-get update && \
|
||||
pkg-config \
|
||||
libssl-dev \
|
||||
protobuf-compiler \
|
||||
openssl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 设置环境变量 (如果需要)
|
||||
|
||||
Reference in New Issue
Block a user