Skip to content

Commit 59f8058

Browse files
committed
Upload the correct folders
1 parent 1f0b3ba commit 59f8058

4 files changed

Lines changed: 79 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 76 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,51 @@ jobs:
5959
uses: actions/upload-artifact@v4
6060
with:
6161
name: idevice-c-examples-macos
62-
path: cpp/examples/build-c/*
62+
path: cpp/examples/build/bin/*
6363

6464
- name: Upload C++ examples/tools
6565
uses: actions/upload-artifact@v4
6666
with:
6767
name: idevice-cpp-examples-macos
68-
path: cpp/examples/build-cpp/*
68+
path: cpp/examples/build/bin/*
69+
70+
- name: Stage Rust tools (arm64)
71+
shell: bash
72+
run: |
73+
mkdir -p dist/arm64
74+
find target/release -maxdepth 1 -type f -exec sh -c '
75+
for f in "$@"; do
76+
if file "$f" | grep -Eq "Mach-O .* executable|ELF .* executable"; then
77+
cp "$f" dist/arm64/
78+
fi
79+
done
80+
' sh {} +
81+
82+
- name: Upload Rust tools (arm64)
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: idevice-tools-macos-arm
86+
path: dist/arm64/*
87+
if-no-files-found: error
88+
89+
- name: Stage Rust tools (x64)
90+
shell: bash
91+
run: |
92+
mkdir -p dist/x64
93+
find target/x86_64-apple-darwin/release -maxdepth 1 -type f -exec sh -c '
94+
for f in "$@"; do
95+
if file "$f" | grep -Eq "Mach-O .* executable|ELF .* executable"; then
96+
cp "$f" dist/x64/
97+
fi
98+
done
99+
' sh {} +
100+
101+
- name: Upload Rust tools (x64)
102+
uses: actions/upload-artifact@v4
103+
with:
104+
name: idevice-tools-macos-intel
105+
path: dist/x64/*
106+
if-no-files-found: error
69107

70108
linux:
71109
name: Linux Build
@@ -112,13 +150,32 @@ jobs:
112150
uses: actions/upload-artifact@v4
113151
with:
114152
name: idevice-c-examples-linux
115-
path: cpp/examples/build-c/*
153+
path: cpp/examples/build/bin/*
116154

117155
- name: Upload C++ examples/tools
118156
uses: actions/upload-artifact@v4
119157
with:
120158
name: idevice-cpp-examples-linux
121-
path: cpp/examples/build-cpp/*
159+
path: cpp/examples/build/bin/*
160+
161+
- name: Stage Rust tools (linux)
162+
shell: bash
163+
run: |
164+
mkdir -p dist
165+
find target/release -maxdepth 1 -type f -exec sh -c '
166+
for f in "$@"; do
167+
if file "$f" | grep -Eq "ELF .* executable"; then
168+
cp "$f" dist/
169+
fi
170+
done
171+
' sh {} +
172+
173+
- name: Upload Rust tools
174+
uses: actions/upload-artifact@v4
175+
with:
176+
name: idevice-tools-linux
177+
path: dist/*
178+
if-no-files-found: error
122179

123180
windows:
124181
name: Windows Build
@@ -161,10 +218,23 @@ jobs:
161218
uses: actions/upload-artifact@v4
162219
with:
163220
name: idevice-c-examples-windows
164-
path: cpp\examples\build-c\*
221+
path: cpp\examples\build\bin\*
165222

166223
- name: Upload C++ examples/tools
167224
uses: actions/upload-artifact@v4
168225
with:
169226
name: idevice-cpp-examples-windows
170-
path: cpp\examples\build-cpp\*
227+
path: cpp\examples\build\bin\*
228+
229+
- name: Stage Rust tools (windows)
230+
shell: pwsh
231+
run: |
232+
New-Item -ItemType Directory -Force -Path dist | Out-Null
233+
Get-ChildItem target\release\*.exe -File | Copy-Item -Destination dist
234+
235+
- name: Upload Rust tools
236+
uses: actions/upload-artifact@v4
237+
with:
238+
name: idevice-tools-windows
239+
path: dist\*.exe
240+
if-no-files-found: error

cpp/examples/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1010
set(HEADER_FILE ${CMAKE_SOURCE_DIR}/../../ffi/idevice.h)
1111
set(STATIC_LIB ${CMAKE_SOURCE_DIR}/../../target/release/libidevice_ffi.a)
1212
set(EXAMPLES_DIR ${CMAKE_SOURCE_DIR}/../examples)
13+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
1314

1415
set(IDEVICE_CPP_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/../include) # cpp/include
1516
set(IDEVICE_FFI_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/../../ffi) # ffi/

ffi/examples/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ project(IdeviceFFI C)
88
set(HEADER_FILE ${CMAKE_SOURCE_DIR}/../idevice.h)
99
set(STATIC_LIB ${CMAKE_SOURCE_DIR}/../../target/release/libidevice_ffi.a)
1010
set(EXAMPLES_DIR ${CMAKE_SOURCE_DIR}/../examples)
11+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
1112

1213
# Find all C example files
1314
file(GLOB EXAMPLE_SOURCES ${EXAMPLES_DIR}/*.c)

justfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ check-features:
66
ci-check: build-ffi-native build-tools-native build-cpp build-c
77
cargo clippy --all-targets --all-features -- -D warnings
88
macos-ci-check: ci-check xcframework
9+
cd tools && cargo build --release --target x86_64-apple-darwin
910

1011
[working-directory: 'ffi']
1112
build-ffi-native:

0 commit comments

Comments
 (0)