Skip to content

Commit 8c88437

Browse files
chris13524llbartekllgithub-actions[bot]jakubuidCopilot
authored
Merge main (#233)
* ios: update features for xcframework build (#201) * savepoint * savepoint * savepoint * savepoint * savepoint * chore: update Package.swift and podspec for version 0.9.4 * chore: update Package.swift and podspec for version 0.9.45 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * iOS: Package split (#203) * savepoint * savepoint * savepoint * savepoint * savepoint * chore: update Package.swift and podspec for version 0.9.4 * chore: update Package.swift and podspec for version 0.9.45 * savepoint * savepoint * savepoint * add podspec update utils workflow * savepoint * update workflows * fix ci --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update Package.swift, utils sources, and podspec for version 0.9.46 * support for 16kb pages * Update gradle.properties Co-authored-by: Copilot <[email protected]> * Update crates/kotlin-ffi/android/build.gradle Co-authored-by: Copilot <[email protected]> * update * change profile for local build * iOS: Package split 2 (#204) * savepoint * savepoint * savepoint * savepoint * savepoint * chore: update Package.swift and podspec for version 0.9.4 * chore: update Package.swift and podspec for version 0.9.45 * savepoint * savepoint * savepoint * add podspec update utils workflow * savepoint * update workflows * fix ci * savepoint * fix pods * savepoint * test * chore: update Package.swift, utils sources, and podspec for version 0.9.50 * rename utils modulemap * chore: update Package.swift, utils sources, and podspec for version 0.9.52 * fix yttrium conflict * update ignore * utils(build): enable Sui, namespace FFI (yttriumUtilsFFI), rename libyttrium-utils.a; update build script * add sui * savepoint * select xcode * chore: update Package.swift, utils sources, and podspec for version 0.9.56 * savepoint * remove prepare from cocoapods * savepoint * chore: update Package.swift, utils sources, and podspec for version 0.9.59 * SPM works * chore: update Package.swift and podspec for version 0.9.60 * chore: update Package.swift, utils sources, and podspec for version 0.9.61 * fix(utils-spm): package XCFramework zip with top-level libyttrium-utils.xcframework directory for SPM * chore: update Package.swift, utils sources, and podspec for version 0.9.62 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update Package.swift and podspec for version 0.9.63 * chore: update Package.swift, utils sources, and podspec for version 0.9.64 * chore: update Package.swift and podspec for version 0.9.67 * Ios deployment target fix (#208) * savepoint * savepoint * savepoint * savepoint * savepoint * chore: update Package.swift and podspec for version 0.9.4 * chore: update Package.swift and podspec for version 0.9.45 * savepoint * savepoint * savepoint * add podspec update utils workflow * savepoint * update workflows * fix ci * savepoint * fix pods * savepoint * test * chore: update Package.swift, utils sources, and podspec for version 0.9.50 * rename utils modulemap * chore: update Package.swift, utils sources, and podspec for version 0.9.52 * fix yttrium conflict * update ignore * utils(build): enable Sui, namespace FFI (yttriumUtilsFFI), rename libyttrium-utils.a; update build script * add sui * savepoint * select xcode * chore: update Package.swift, utils sources, and podspec for version 0.9.56 * savepoint * remove prepare from cocoapods * savepoint * chore: update Package.swift, utils sources, and podspec for version 0.9.59 * SPM works * chore: update Package.swift and podspec for version 0.9.60 * chore: update Package.swift, utils sources, and podspec for version 0.9.61 * fix(utils-spm): package XCFramework zip with top-level libyttrium-utils.xcframework directory for SPM * update scripts * chore: update Package.swift and podspec for version 0.9.65 * chore: update Package.swift, utils sources, and podspec for version 0.9.66 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update Package.swift and podspec for version 0.9.68 * savepoint * lint --------- Co-authored-by: Bartosz Rozwarski <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: jakubuid <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 90e86f5 commit 8c88437

25 files changed

+12067
-4565
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,11 @@ jobs:
148148
- run: rustup update ${{ env.RUST_MSRV }} && rustup default ${{ env.RUST_MSRV }}
149149
- uses: Swatinem/rust-cache@v2
150150
- name: Select Xcode 15.4
151-
run: sudo xcode-select -s /Applications/Xcode_15.4.app
151+
run: sudo xcode-select -s /Applications/Xcode.app
152152

153153
# Build bindings
154154
- run: make build-xcframework
155+
- run: make build-utils-xcframework
155156

156157
# Don't think we actually need this check, since bindings will be updated during release
157158
# - run: git diff crates/ffi
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: Build and Release Yttrium Swift Utils
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to release (e.g. 0.0.1)'
8+
required: true
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
VERSION: ${{ github.event.inputs.version || '0.0.1' }}
13+
TARGET_BRANCH: ${{ github.ref_name }}
14+
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
release-swift-utils-package:
20+
runs-on: macos-latest-xlarge
21+
strategy:
22+
matrix:
23+
config:
24+
- debug
25+
steps:
26+
# 1. Checkout
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
# 2. Install sccache
33+
- name: Run sccache-cache
34+
uses: mozilla-actions/[email protected]
35+
36+
# 3. Install pnpm
37+
- uses: pnpm/action-setup@v4
38+
with:
39+
version: 9
40+
run_install: false
41+
42+
# 4. Install Rust
43+
- name: Install Rust
44+
uses: dtolnay/rust-toolchain@stable
45+
46+
# 5. Select Xcode
47+
- name: Select Xcode
48+
run: sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
49+
50+
# 6. Build and Package Utils XCFramework
51+
- name: Build and Package Utils XCFramework
52+
run: |
53+
make build-utils-xcframework
54+
make generate-package-swift-utils
55+
56+
# 7. Calculate Utils XCFramework Checksum (SPM)
57+
- name: Calculate Utils XCFramework Checksum
58+
id: checksum
59+
run: |
60+
CHECKSUM=$(swift package compute-checksum Output/libyttrium-utils.xcframework.zip)
61+
echo "checksum=$CHECKSUM" >> $GITHUB_OUTPUT
62+
echo "Utils XCFramework checksum: $CHECKSUM"
63+
64+
# 8. Update Package.swift for Utils Only
65+
- name: Update Package.swift for Utils Only
66+
run: |
67+
chmod +x scripts/update-package-swift-utils.sh
68+
./scripts/update-package-swift-utils.sh "$VERSION" "${{ steps.checksum.outputs.checksum }}"
69+
70+
# 9. Update Utils Podspec version
71+
- name: Update Utils Podspec version
72+
run: |
73+
sed -i '' "s/spec.version = \".*\"/spec.version = \"$VERSION\"/" YttriumUtilsWrapper.podspec
74+
75+
# Update the binary pod URL to the new pod zip
76+
DOWNLOAD_URL="https://github.com/reown-com/yttrium/releases/download/$VERSION/libyttrium-utils-pod.zip"
77+
sed -i '' "s|https://github.com/reown-com/yttrium/releases/download/[^/]*/libyttrium-utils-pod.zip|${DOWNLOAD_URL}|g" YttriumUtilsWrapper.podspec
78+
79+
# 10. Commit and Push Package.swift, Utils Sources, and Podspec
80+
- name: Commit and Push Package.swift, Utils Sources, and Podspec
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
run: |
84+
git config user.name "github-actions[bot]"
85+
git config user.email "github-actions[bot]@users.noreply.github.com"
86+
git add Package.swift platforms/swift/Sources/YttriumUtils/* YttriumUtilsWrapper.podspec
87+
if git diff --cached --quiet; then
88+
echo "No changes to commit."
89+
else
90+
git commit -m "chore: update Package.swift, utils sources, and podspec for version $VERSION"
91+
git push origin HEAD:$TARGET_BRANCH
92+
fi
93+
94+
# 11. Create Git Tag for Utils
95+
- name: Create Git Tag for Utils
96+
env:
97+
VERSION: ${{ env.VERSION }}
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
run: |
100+
git fetch origin $TARGET_BRANCH
101+
COMMIT_HASH=$(git rev-parse HEAD)
102+
echo "Tagging commit ${COMMIT_HASH} with version ${VERSION}"
103+
git tag -a "${VERSION}" -m "Release YttriumUtils version ${VERSION}" "${COMMIT_HASH}"
104+
git push origin "${VERSION}"
105+
106+
# 12. Create a GitHub Release for Utils
107+
- name: Create Release for Utils
108+
id: create_release_utils
109+
uses: actions/create-release@v1
110+
env:
111+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112+
with:
113+
tag_name: ${{ env.VERSION }}
114+
release_name: YttriumUtils ${{ env.VERSION }}
115+
draft: false
116+
prerelease: true
117+
118+
# 13. Upload Utils SPM XCFramework zip to the Release
119+
- name: Upload Utils SPM zip to Release
120+
uses: actions/upload-release-asset@v1
121+
env:
122+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
with:
124+
upload_url: ${{ steps.create_release_utils.outputs.upload_url }}
125+
asset_path: ./Output/libyttrium-utils.xcframework.zip
126+
asset_name: libyttrium-utils.xcframework.zip
127+
asset_content_type: application/zip
128+
129+
# 14. Upload Utils CocoaPods pod zip to the Release
130+
- name: Upload Utils pod zip to Release
131+
uses: actions/upload-release-asset@v1
132+
env:
133+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134+
with:
135+
upload_url: ${{ steps.create_release_utils.outputs.upload_url }}
136+
asset_path: ./Output/libyttrium-utils-pod.zip
137+
asset_name: libyttrium-utils-pod.zip
138+
asset_content_type: application/zip
139+
140+
# 15. Publish Utils CocoaPods
141+
- name: Publish Utils CocoaPods
142+
env:
143+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
144+
run: |
145+
pod trunk push YttriumUtilsWrapper.podspec --allow-warnings

.github/workflows/release-swift.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,25 @@ jobs:
5757
- name: Build and Package XCFramework
5858
run: |
5959
make build-xcframework
60-
make generate-package-swift
60+
# Generate the XCFramework zip for release
61+
mkdir -p Output
62+
zip -r Output/libyttrium.xcframework.zip target/ios/libyttrium.xcframework
6163
62-
# 7. Update Podspec with Version and Download URL
64+
# 7. Calculate Core XCFramework Checksum
65+
- name: Calculate Core XCFramework Checksum
66+
id: checksum
67+
run: |
68+
CHECKSUM=$(swift package compute-checksum Output/libyttrium.xcframework.zip)
69+
echo "checksum=$CHECKSUM" >> $GITHUB_OUTPUT
70+
echo "Core XCFramework checksum: $CHECKSUM"
71+
72+
# 8. Update Package.swift for Core Only
73+
- name: Update Package.swift for Core Only
74+
run: |
75+
chmod +x scripts/update-package-swift-core.sh
76+
./scripts/update-package-swift-core.sh "$VERSION" "${{ steps.checksum.outputs.checksum }}"
77+
78+
# 9. Update Podspec with Version and Download URL
6379
- name: Update Podspec with Version and Download URL
6480
run: |
6581
# Replace the version line in Podspec
@@ -73,7 +89,7 @@ jobs:
7389
# Update the download URL to the correct version
7490
sed -i '' "s|https://github.com/reown-com/yttrium/releases/download/[^']*|${DOWNLOAD_URL}|g" YttriumWrapper.podspec
7591
76-
# 8. Commit and Push Package.swift and Podspec
92+
# 10. Commit and Push Package.swift and Podspec
7793
- name: Commit and Push Package.swift and Podspec
7894
env:
7995
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Use default token
@@ -88,7 +104,7 @@ jobs:
88104
git push origin HEAD:$TARGET_BRANCH
89105
fi
90106
91-
# 9. Create Git Tag
107+
# 11. Create Git Tag
92108
- name: Create Git Tag
93109
env:
94110
VERSION: ${{ env.VERSION }}
@@ -107,7 +123,7 @@ jobs:
107123
# Push the tag to the repository
108124
git push origin "${VERSION}"
109125
110-
# 10. Create a GitHub Release
126+
# 12. Create a GitHub Release
111127
- name: Create Release
112128
id: create_release
113129
uses: actions/create-release@v1
@@ -123,7 +139,7 @@ jobs:
123139
draft: false
124140
prerelease: true
125141

126-
# 11. Upload XCFramework to the Release
142+
# 13. Upload XCFramework to the Release
127143
- name: Upload XCFramework to Release
128144
uses: actions/upload-release-asset@v1
129145
env:
@@ -134,7 +150,7 @@ jobs:
134150
asset_name: libyttrium.xcframework.zip
135151
asset_content_type: application/zip
136152

137-
# 12. Publish to CocoaPods Trunk
153+
# 14. Publish to CocoaPods Trunk
138154
- name: Publish to CocoaPods Trunk
139155
env:
140156
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ Utilities/InstalledSwiftPMConfiguration/config.json
3737
benchmark-profile-output-sizes.csv
3838
benchmark*.csv
3939
benchmark/
40+
*.xcframework.zip

Makefile

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ test-swift-apple-platforms:
3030
build-xcframework:
3131
sh scripts/build-xcframework.sh
3232

33+
build-utils-xcframework:
34+
sh scripts/build-utils-xcframework.sh
35+
3336
set-up-local-swift-package:
3437
sh scripts/set-up-local-swift-package.sh
3538

@@ -46,10 +49,32 @@ local-infra-forked:
4649
local-infra-7702:
4750
cd test/scripts/7702 && sh local-infra.sh
4851

49-
.PHONY: generate-package-swift
50-
generate-package-swift:
51-
chmod +x scripts/generate-package-swift.sh
52-
./scripts/generate-package-swift.sh
52+
.PHONY: generate-package-swift-utils
53+
generate-package-swift-utils:
54+
chmod +x scripts/generate-package-swift-utils.sh
55+
./scripts/generate-package-swift-utils.sh
56+
57+
.PHONY: update-package-swift-core
58+
update-package-swift-core:
59+
chmod +x scripts/update-package-swift-core.sh
60+
@echo "Usage: make update-package-swift-core VERSION=0.9.46 CHECKSUM=abc123..."
61+
@if [ -z "$(VERSION)" ] || [ -z "$(CHECKSUM)" ]; then \
62+
echo "Error: VERSION and CHECKSUM are required"; \
63+
echo "Example: make update-package-swift-core VERSION=0.9.46 CHECKSUM=abc123..."; \
64+
exit 1; \
65+
fi
66+
./scripts/update-package-swift-core.sh $(VERSION) $(CHECKSUM)
67+
68+
.PHONY: update-package-swift-utils
69+
update-package-swift-utils:
70+
chmod +x scripts/update-package-swift-utils.sh
71+
@echo "Usage: make update-package-swift-utils VERSION=0.0.2 CHECKSUM=xyz789..."
72+
@if [ -z "$(VERSION)" ] || [ -z "$(CHECKSUM)" ]; then \
73+
echo "Error: VERSION and CHECKSUM are required"; \
74+
echo "Example: make update-package-swift-utils VERSION=0.0.2 CHECKSUM=xyz789..."; \
75+
exit 1; \
76+
fi
77+
./scripts/update-package-swift-utils.sh $(VERSION) $(CHECKSUM)
5378

5479
.PHONY: build build-ios-bindings build-swift-apple-platforms test-swift-apple-platforms fetch-thirdparty setup-thirdparty test format clean local-infra local-infra-forked local-infra-7702
5580

Package.swift

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,19 @@ let yttriumXcframeworkTarget: Target = useLocalRustXcframework ?
1111
) :
1212
.binaryTarget(
1313
name: "YttriumXCFramework",
14-
url: "https://github.com/reown-com/yttrium/releases/download/0.9.57/libyttrium.xcframework.zip",
15-
checksum: "3a2a36a251aafabb8f64780bff826d2088ce6a0a92a8934d7ac2f2b18667e2fa"
14+
url: "https://github.com/reown-com/yttrium/releases/download/0.9.68/libyttrium.xcframework.zip",
15+
checksum: "3374bca5bb216ab5a782305ef806cd19d5ef64a9537a9aad68b10ea8a7dfcbf9"
16+
)
17+
18+
let yttriumUtilsXcframeworkTarget: Target = useLocalRustXcframework ?
19+
.binaryTarget(
20+
name: "YttriumUtilsXCFramework",
21+
path: "target/ios-utils/libyttrium-utils.xcframework"
22+
) :
23+
.binaryTarget(
24+
name: "YttriumUtilsXCFramework",
25+
url: "https://github.com/reown-com/yttrium/releases/download/0.9.64/libyttrium-utils.xcframework.zip",
26+
checksum: "4c344ef8463f39dce1e5c7e0d58bd2b27be2cfb882e33ff48b8810858f045d37"
1627
)
1728

1829
let package = Package(
@@ -25,9 +36,14 @@ let package = Package(
2536
name: "Yttrium",
2637
targets: ["Yttrium"]
2738
),
39+
.library(
40+
name: "YttriumUtils",
41+
targets: ["YttriumUtils"]
42+
),
2843
],
2944
targets: [
3045
yttriumXcframeworkTarget,
46+
yttriumUtilsXcframeworkTarget,
3147
.target(
3248
name: "Yttrium",
3349
dependencies: ["YttriumXCFramework"],
@@ -36,6 +52,15 @@ let package = Package(
3652
cSettings: [
3753
.headerSearchPath(".")
3854
]
55+
),
56+
.target(
57+
name: "YttriumUtils",
58+
dependencies: ["YttriumUtilsXCFramework"],
59+
path: "platforms/swift/Sources/YttriumUtils",
60+
publicHeadersPath: ".",
61+
cSettings: [
62+
.headerSearchPath(".")
63+
]
3964
)
4065
]
4166
)

YttriumUtilsWrapper.podspec

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Pod::Spec.new do |spec|
2+
spec.name = "YttriumUtilsWrapper"
3+
spec.version = "0.9.64"
4+
spec.summary = "Yttrium Utils - Multi-blockchain utilities for EIP155, Stacks, and Chain Abstraction"
5+
spec.description = <<-DESC
6+
Yttrium Utils provides multi-blockchain utilities including EIP155 support, Stacks integration,
7+
and Chain Abstraction capabilities without the full Yttrium Core dependencies.
8+
DESC
9+
10+
spec.homepage = "https://github.com/reown-com/yttrium"
11+
spec.license = { :type => "Apache 2.0", :file => "LICENSE" }
12+
spec.author = { "Reown" => "[email protected]" }
13+
14+
spec.ios.deployment_target = "13.0"
15+
spec.swift_version = "5.9"
16+
17+
# Binary pod via :http to avoid running heavy prepare_command on trunk
18+
# Binary asset hosted on GitHub Releases; CI updates the version
19+
spec.source = { :http => "https://github.com/reown-com/yttrium/releases/download/0.9.64/libyttrium-utils-pod.zip" }
20+
21+
# The zip contains libyttrium-utils.xcframework at root and Sources/YttriumUtils/*.swift
22+
spec.vendored_frameworks = "libyttrium-utils.xcframework"
23+
spec.source_files = "Sources/YttriumUtils/**/*.swift"
24+
25+
# Since this is a utils library with fewer dependencies, we don't need complex configuration
26+
spec.user_target_xcconfig = {
27+
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'
28+
}
29+
spec.pod_target_xcconfig = {
30+
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'
31+
}
32+
33+
# No prepare_command needed for binary pod
34+
end

YttriumWrapper.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'YttriumWrapper'
3-
s.version = '0.9.57'
3+
s.version = '0.9.68'
44
s.summary = '4337 implementation'
55
s.description = '4337 implementation and Chain Abstraction'
66
s.homepage = 'https://reown.com'
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
1818

1919
# Include the vendored framework with flattened structure
2020
s.prepare_command = <<-SCRIPT
21-
curl -L -o libyttrium.xcframework.zip 'https://github.com/reown-com/yttrium/releases/download/0.9.57/libyttrium.xcframework.zip'
21+
curl -L -o libyttrium.xcframework.zip 'https://github.com/reown-com/yttrium/releases/download/0.9.68/libyttrium.xcframework.zip'
2222
unzip -o libyttrium.xcframework.zip -d platforms/swift/
2323
rm libyttrium.xcframework.zip
2424

0 commit comments

Comments
 (0)