Merge pull request #6457 from menloresearch/chore/makefile-rust-targets

chore: makefile rust targets macos
This commit is contained in:
Nguyen Ngoc Minh 2025-09-15 12:03:17 +07:00 committed by GitHub
commit 55edc7129e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 29 deletions

View File

@ -89,7 +89,6 @@ jobs:
- name: Build app
run: |
rustup target add x86_64-apple-darwin
make build
env:
APP_PATH: '.'

View File

@ -92,31 +92,6 @@ jobs:
run: |
cargo install ctoml
- name: Create bun and uv universal
run: |
mkdir -p ./src-tauri/resources/bin/
cd ./src-tauri/resources/bin/
curl -L -o bun-darwin-x64.zip https://github.com/oven-sh/bun/releases/download/bun-v1.2.10/bun-darwin-x64.zip
curl -L -o bun-darwin-aarch64.zip https://github.com/oven-sh/bun/releases/download/bun-v1.2.10/bun-darwin-aarch64.zip
unzip bun-darwin-x64.zip
unzip bun-darwin-aarch64.zip
lipo -create -output bun-universal-apple-darwin bun-darwin-x64/bun bun-darwin-aarch64/bun
cp -f bun-darwin-aarch64/bun bun-aarch64-apple-darwin
cp -f bun-darwin-x64/bun bun-x86_64-apple-darwin
cp -f bun-universal-apple-darwin bun
curl -L -o uv-x86_64.tar.gz https://github.com/astral-sh/uv/releases/download/0.6.17/uv-x86_64-apple-darwin.tar.gz
curl -L -o uv-arm64.tar.gz https://github.com/astral-sh/uv/releases/download/0.6.17/uv-aarch64-apple-darwin.tar.gz
tar -xzf uv-x86_64.tar.gz
tar -xzf uv-arm64.tar.gz
mv uv-x86_64-apple-darwin uv-x86_64
mv uv-aarch64-apple-darwin uv-aarch64
lipo -create -output uv-universal-apple-darwin uv-x86_64/uv uv-aarch64/uv
cp -f uv-x86_64/uv uv-x86_64-apple-darwin
cp -f uv-aarch64/uv uv-aarch64-apple-darwin
cp -f uv-universal-apple-darwin uv
ls -la
- name: Update app version based on latest release tag with build number
run: |
echo "Version: ${{ inputs.new_version }}"
@ -167,7 +142,6 @@ jobs:
- name: Build app
run: |
rustup target add x86_64-apple-darwin
make build
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -30,6 +30,17 @@ endif
yarn build:core
yarn build:extensions && yarn build:extensions-web
# Install required Rust targets for macOS universal builds
install-rust-targets:
ifeq ($(shell uname -s),Darwin)
@echo "Detected macOS, installing universal build targets..."
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
@echo "Rust targets installed successfully!"
else
@echo "Not macOS; skipping Rust target installation."
endif
dev: install-and-build
yarn download:bin
yarn download:lib
@ -68,11 +79,12 @@ test: lint
cargo test --manifest-path src-tauri/utils/Cargo.toml
# Builds and publishes the app
build-and-publish: install-and-build
build-and-publish: install-and-build install-rust-targets
yarn build
# Build
build: install-and-build
build: install-and-build install-rust-targets
yarn download:bin
yarn download:lib
yarn build