diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8b600b..9af92a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,13 +59,51 @@ jobs: uses: actions/upload-artifact@v4 with: name: idevice-c-examples-macos - path: cpp/examples/build-c/* + path: cpp/examples/build/bin/* - name: Upload C++ examples/tools uses: actions/upload-artifact@v4 with: name: idevice-cpp-examples-macos - path: cpp/examples/build-cpp/* + path: cpp/examples/build/bin/* + + - name: Stage Rust tools (arm64) + shell: bash + run: | + mkdir -p dist/arm64 + find target/release -maxdepth 1 -type f -exec sh -c ' + for f in "$@"; do + if file "$f" | grep -Eq "Mach-O .* executable|ELF .* executable"; then + cp "$f" dist/arm64/ + fi + done + ' sh {} + + + - name: Upload Rust tools (arm64) + uses: actions/upload-artifact@v4 + with: + name: idevice-tools-macos-arm + path: dist/arm64/* + if-no-files-found: error + + - name: Stage Rust tools (x64) + shell: bash + run: | + mkdir -p dist/x64 + find target/x86_64-apple-darwin/release -maxdepth 1 -type f -exec sh -c ' + for f in "$@"; do + if file "$f" | grep -Eq "Mach-O .* executable|ELF .* executable"; then + cp "$f" dist/x64/ + fi + done + ' sh {} + + + - name: Upload Rust tools (x64) + uses: actions/upload-artifact@v4 + with: + name: idevice-tools-macos-intel + path: dist/x64/* + if-no-files-found: error linux: name: Linux Build @@ -112,13 +150,32 @@ jobs: uses: actions/upload-artifact@v4 with: name: idevice-c-examples-linux - path: cpp/examples/build-c/* + path: cpp/examples/build/bin/* - name: Upload C++ examples/tools uses: actions/upload-artifact@v4 with: name: idevice-cpp-examples-linux - path: cpp/examples/build-cpp/* + path: cpp/examples/build/bin/* + + - name: Stage Rust tools (linux) + shell: bash + run: | + mkdir -p dist + find target/release -maxdepth 1 -type f -exec sh -c ' + for f in "$@"; do + if file "$f" | grep -Eq "ELF .* executable"; then + cp "$f" dist/ + fi + done + ' sh {} + + + - name: Upload Rust tools + uses: actions/upload-artifact@v4 + with: + name: idevice-tools-linux + path: dist/* + if-no-files-found: error windows: name: Windows Build @@ -161,10 +218,23 @@ jobs: uses: actions/upload-artifact@v4 with: name: idevice-c-examples-windows - path: cpp\examples\build-c\* + path: cpp\examples\build\bin\* - name: Upload C++ examples/tools uses: actions/upload-artifact@v4 with: name: idevice-cpp-examples-windows - path: cpp\examples\build-cpp\* + path: cpp\examples\build\bin\* + + - name: Stage Rust tools (windows) + shell: pwsh + run: | + New-Item -ItemType Directory -Force -Path dist | Out-Null + Get-ChildItem target\release\*.exe -File | Copy-Item -Destination dist + + - name: Upload Rust tools + uses: actions/upload-artifact@v4 + with: + name: idevice-tools-windows + path: dist\*.exe + if-no-files-found: error diff --git a/cpp/examples/CMakeLists.txt b/cpp/examples/CMakeLists.txt index 63d607d..548a39f 100644 --- a/cpp/examples/CMakeLists.txt +++ b/cpp/examples/CMakeLists.txt @@ -10,6 +10,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(HEADER_FILE ${CMAKE_SOURCE_DIR}/../../ffi/idevice.h) set(STATIC_LIB ${CMAKE_SOURCE_DIR}/../../target/release/libidevice_ffi.a) set(EXAMPLES_DIR ${CMAKE_SOURCE_DIR}/../examples) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(IDEVICE_CPP_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/../include) # cpp/include set(IDEVICE_FFI_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/../../ffi) # ffi/ diff --git a/ffi/examples/CMakeLists.txt b/ffi/examples/CMakeLists.txt index d68866f..e9d5567 100644 --- a/ffi/examples/CMakeLists.txt +++ b/ffi/examples/CMakeLists.txt @@ -8,6 +8,7 @@ project(IdeviceFFI C) set(HEADER_FILE ${CMAKE_SOURCE_DIR}/../idevice.h) set(STATIC_LIB ${CMAKE_SOURCE_DIR}/../../target/release/libidevice_ffi.a) set(EXAMPLES_DIR ${CMAKE_SOURCE_DIR}/../examples) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) # Find all C example files file(GLOB EXAMPLE_SOURCES ${EXAMPLES_DIR}/*.c) diff --git a/justfile b/justfile index f339e34..924d8b7 100644 --- a/justfile +++ b/justfile @@ -6,6 +6,7 @@ check-features: ci-check: build-ffi-native build-tools-native build-cpp build-c cargo clippy --all-targets --all-features -- -D warnings macos-ci-check: ci-check xcframework + cd tools && cargo build --release --target x86_64-apple-darwin [working-directory: 'ffi'] build-ffi-native: