Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/swift-sdk-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,61 @@ jobs:
rustup toolchain install "$TOOLCHAIN" --profile minimal --no-self-update
rustup target add --toolchain "$TOOLCHAIN" aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios

- name: Clean previous Rust build artifacts
shell: bash
run: |
set -euxo pipefail
cargo clean || true
RUST_DASHCORE_DIR="$(dirname "$GITHUB_WORKSPACE")/rust-dashcore"
if [ -d "$RUST_DASHCORE_DIR" ]; then
(cd "$RUST_DASHCORE_DIR" && cargo clean || true)
fi

- name: Build dash-spv-ffi static libs explicitly
shell: bash
run: |
set -euxo pipefail
export IPHONEOS_DEPLOYMENT_TARGET="18.0"
export IPHONESIMULATOR_DEPLOYMENT_TARGET="18.0"
export CARGO_TARGET_AARCH64_APPLE_IOS_RUSTFLAGS="${CARGO_TARGET_AARCH64_APPLE_IOS_RUSTFLAGS:-} -C link-arg=-mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"
export CARGO_TARGET_AARCH64_APPLE_IOS_SIM_RUSTFLAGS="${CARGO_TARGET_AARCH64_APPLE_IOS_SIM_RUSTFLAGS:-} -C link-arg=-mios-version-min=${IPHONESIMULATOR_DEPLOYMENT_TARGET}"
export CARGO_TARGET_X86_64_APPLE_IOS_RUSTFLAGS="${CARGO_TARGET_X86_64_APPLE_IOS_RUSTFLAGS:-} -C link-arg=-mios-version-min=${IPHONESIMULATOR_DEPLOYMENT_TARGET}"
RUST_DASHCORE_DIR="$(dirname "$GITHUB_WORKSPACE")/rust-dashcore"
cd "$RUST_DASHCORE_DIR/dash-spv-ffi"
TOOLCHAIN="${{ steps.dashcore_toolchain.outputs.channel }}"
cargo +"$TOOLCHAIN" build --lib --release --target aarch64-apple-ios
cargo +"$TOOLCHAIN" build --lib --release --target aarch64-apple-ios-sim
cargo +"$TOOLCHAIN" build --lib --release --target x86_64-apple-ios

- name: Build DashSDKFFI.xcframework and install into Swift package
run: |
bash packages/swift-sdk/build_ios.sh

- name: Collect build logs on failure
if: failure()
shell: bash
run: |
set -euxo pipefail
shopt -s nullglob
LOG_DIR="$RUNNER_TEMP/swift-sdk-build-logs"
mkdir -p "$LOG_DIR"
for path in /tmp/*.log; do
if [ -f "$path" ]; then
cp "$path" "$LOG_DIR/"
fi
done
if [ -d "$HOME/.cargo" ]; then
find "$HOME/.cargo" -name "*.log" -maxdepth 3 -type f -print0 2>/dev/null | xargs -0 -I{} cp "{}" "$LOG_DIR/" || true
fi
find "$GITHUB_WORKSPACE" -maxdepth 4 -name "*.log" -type f -print0 2>/dev/null | xargs -0 -I{} cp "{}" "$LOG_DIR/" || true

- name: Upload build logs artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: swift-sdk-build-logs
path: ${{ runner.temp }}/swift-sdk-build-logs

- name: Zip XCFramework and compute checksum
run: |
cd packages/swift-sdk
Expand Down
Loading
Loading