Skip to content

Commit 41d57d6

Browse files
authored
chore(swift-sdk): swift and unified sdk generation rewrite (#3401)
1 parent 94cefb3 commit 41d57d6

23 files changed

Lines changed: 453 additions & 3788 deletions

‎.github/workflows/swift-sdk-build.yml‎

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -102,68 +102,6 @@ jobs:
102102
echo "PROTOC=$HOME/.local/protoc-32.0/bin/protoc" >> "$GITHUB_ENV"
103103
"$HOME/.local/protoc-32.0/bin/protoc" --version
104104
105-
- name: Determine rust-dashcore revision (from workspace Cargo.toml)
106-
id: dashcore_rev
107-
shell: bash
108-
run: |
109-
set -euo pipefail
110-
# Use the same rust-dashcore revision/tag as rs-dpp
111-
# Try to find tag first (preferred format)
112-
REV=$(grep -E '^[[:space:]]*dashcore[[:space:]]*=[[:space:]]*\{.*tag[[:space:]]*=' Cargo.toml \
113-
| sed -E 's/.*tag[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/' \
114-
| head -n1 || true)
115-
# If no tag found, try rev format
116-
if [ -z "${REV:-}" ]; then
117-
REV=$(grep -E '^[[:space:]]*dashcore[[:space:]]*=[[:space:]]*\{.*rev[[:space:]]*=' Cargo.toml \
118-
| sed -E 's/.*rev[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/' \
119-
| head -n1 || true)
120-
fi
121-
if [ -z "${REV:-}" ]; then
122-
echo "Failed to determine rust-dashcore revision or tag from workspace Cargo.toml" >&2
123-
exit 1
124-
fi
125-
echo "rev=$REV" >> "$GITHUB_OUTPUT"
126-
127-
- name: Checkout rust-dashcore at required revision
128-
shell: bash
129-
run: |
130-
set -euxo pipefail
131-
BASE_DIR="$(dirname "$GITHUB_WORKSPACE")"
132-
cd "$BASE_DIR"
133-
if [ -d rust-dashcore/.git ]; then
134-
echo "Updating existing rust-dashcore checkout"
135-
cd rust-dashcore
136-
git fetch --all --tags --prune
137-
else
138-
git clone --filter=blob:none https://github.com/dashpay/rust-dashcore.git rust-dashcore
139-
cd rust-dashcore
140-
fi
141-
git reset --hard # clean any local changes from previous runs, possibly with another branch
142-
git checkout "${{ steps.dashcore_rev.outputs.rev }}"
143-
144-
- name: Determine rust-dashcore toolchain channel
145-
id: dashcore_toolchain
146-
shell: bash
147-
run: |
148-
set -euo pipefail
149-
FILE="$(dirname "$GITHUB_WORKSPACE")/rust-dashcore/rust-toolchain.toml"
150-
if [ -f "$FILE" ]; then
151-
CHANNEL=$(grep -E '^[[:space:]]*channel[[:space:]]*=' "$FILE" | sed -E 's/.*"([^"]+)".*/\1/' | head -n1 || true)
152-
fi
153-
CHANNEL=${CHANNEL:-stable}
154-
echo "channel=$CHANNEL" >> "$GITHUB_OUTPUT"
155-
echo "RUST_DASHCORE_TOOLCHAIN=$CHANNEL" >> "$GITHUB_ENV"
156-
157-
- name: Ensure rust-dashcore toolchain has iOS targets
158-
shell: bash
159-
run: |
160-
set -euxo pipefail
161-
RUST_DASHCORE_DIR="$(dirname "$GITHUB_WORKSPACE")/rust-dashcore"
162-
cd "$RUST_DASHCORE_DIR"
163-
TOOLCHAIN="${{ steps.dashcore_toolchain.outputs.channel }}"
164-
rustup toolchain install "$TOOLCHAIN" --profile minimal --no-self-update
165-
rustup target add --toolchain "$TOOLCHAIN" aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios
166-
167105
- name: Clean Xcode derived data and Swift package caches
168106
run: |
169107
rm -rf ~/Library/Developer/Xcode/DerivedData/* || true
@@ -172,7 +110,7 @@ jobs:
172110
173111
- name: Build DashSDKFFI.xcframework and install into Swift package
174112
run: |
175-
bash packages/swift-sdk/build_ios.sh
113+
bash packages/swift-sdk/build_ios.sh --target all --profile release
176114
177115
- name: Zip XCFramework and compute checksum
178116
run: |

‎.github/workflows/swift-sdk-release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959

6060
- name: Build DashSDKFFI.xcframework and install into Swift package
6161
run: |
62-
bash packages/swift-sdk/build_ios.sh
62+
bash packages/swift-sdk/build_ios.sh --target all --profile release
6363
6464
- name: Zip XCFramework and compute checksum
6565
id: zip

0 commit comments

Comments
 (0)