Skip to content
Merged
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
64 changes: 1 addition & 63 deletions .github/workflows/swift-sdk-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,68 +102,6 @@ jobs:
echo "PROTOC=$HOME/.local/protoc-32.0/bin/protoc" >> "$GITHUB_ENV"
"$HOME/.local/protoc-32.0/bin/protoc" --version

- name: Determine rust-dashcore revision (from workspace Cargo.toml)
id: dashcore_rev
shell: bash
run: |
set -euo pipefail
# Use the same rust-dashcore revision/tag as rs-dpp
# Try to find tag first (preferred format)
REV=$(grep -E '^[[:space:]]*dashcore[[:space:]]*=[[:space:]]*\{.*tag[[:space:]]*=' Cargo.toml \
| sed -E 's/.*tag[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/' \
| head -n1 || true)
# If no tag found, try rev format
if [ -z "${REV:-}" ]; then
REV=$(grep -E '^[[:space:]]*dashcore[[:space:]]*=[[:space:]]*\{.*rev[[:space:]]*=' Cargo.toml \
| sed -E 's/.*rev[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/' \
| head -n1 || true)
fi
if [ -z "${REV:-}" ]; then
echo "Failed to determine rust-dashcore revision or tag from workspace Cargo.toml" >&2
exit 1
fi
echo "rev=$REV" >> "$GITHUB_OUTPUT"

- name: Checkout rust-dashcore at required revision
shell: bash
run: |
set -euxo pipefail
BASE_DIR="$(dirname "$GITHUB_WORKSPACE")"
cd "$BASE_DIR"
if [ -d rust-dashcore/.git ]; then
echo "Updating existing rust-dashcore checkout"
cd rust-dashcore
git fetch --all --tags --prune
else
git clone --filter=blob:none https://github.com/dashpay/rust-dashcore.git rust-dashcore
cd rust-dashcore
fi
git reset --hard # clean any local changes from previous runs, possibly with another branch
git checkout "${{ steps.dashcore_rev.outputs.rev }}"

- name: Determine rust-dashcore toolchain channel
id: dashcore_toolchain
shell: bash
run: |
set -euo pipefail
FILE="$(dirname "$GITHUB_WORKSPACE")/rust-dashcore/rust-toolchain.toml"
if [ -f "$FILE" ]; then
CHANNEL=$(grep -E '^[[:space:]]*channel[[:space:]]*=' "$FILE" | sed -E 's/.*"([^"]+)".*/\1/' | head -n1 || true)
fi
CHANNEL=${CHANNEL:-stable}
echo "channel=$CHANNEL" >> "$GITHUB_OUTPUT"
echo "RUST_DASHCORE_TOOLCHAIN=$CHANNEL" >> "$GITHUB_ENV"

- name: Ensure rust-dashcore toolchain has iOS targets
shell: bash
run: |
set -euxo pipefail
RUST_DASHCORE_DIR="$(dirname "$GITHUB_WORKSPACE")/rust-dashcore"
cd "$RUST_DASHCORE_DIR"
TOOLCHAIN="${{ steps.dashcore_toolchain.outputs.channel }}"
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 Xcode derived data and Swift package caches
run: |
rm -rf ~/Library/Developer/Xcode/DerivedData/* || true
Expand All @@ -172,7 +110,7 @@ jobs:

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

- name: Zip XCFramework and compute checksum
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/swift-sdk-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:

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

- name: Zip XCFramework and compute checksum
id: zip
Expand Down
Loading
Loading