diff --git a/.github/workflows/release-swift.yml b/.github/workflows/release-swift.yml index bdd45b6..bc2ca8f 100644 --- a/.github/workflows/release-swift.yml +++ b/.github/workflows/release-swift.yml @@ -130,4 +130,31 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./Output/RustXcframework.xcframework.zip asset_name: RustXcframework.xcframework.zip - asset_content_type: application/zip \ No newline at end of file + asset_content_type: application/zip + + # 14. Update Podspec with Version and Download URL + - name: Update Podspec with Version and Download URL + run: | + # Replace the version line + sed -i '' "s/^ s\.version *= *.*/ s.version = '${VERSION}'/g" YttriumWrapper.podspec + + # Construct the download URL + DOWNLOAD_URL="https://github.com/reown-com/yttrium/releases/download/${VERSION}/RustXcframework.xcframework.zip" + + # Replace the download URL in prepare_command + sed -i '' "s|curl -L -o RustXcframework.xcframework.zip '.*'|curl -L -o RustXcframework.xcframework.zip '${DOWNLOAD_URL}'|g" YttriumWrapper.podspec + + # Commit the updated podspec + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add YttriumWrapper.podspec + git commit -m "chore: update podspec for version ${VERSION}" + git push origin HEAD:${TARGET_BRANCH} + + # 15. Publish to CocoaPods Trunk + - name: Publish to CocoaPods Trunk + env: + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} + run: | + pod trunk push YttriumWrapper.podspec --allow-warnings + \ No newline at end of file diff --git a/YttriumWrapper.podspec b/YttriumWrapper.podspec index 007e397..40a25ca 100644 --- a/YttriumWrapper.podspec +++ b/YttriumWrapper.podspec @@ -1,16 +1,12 @@ Pod::Spec.new do |s| s.name = 'YttriumWrapper' - s.version = '0.1.0' + s.version = '0.0.0' s.summary = '4337 implementation' - s.description = <<-DESC - YttriumWrapper is a Swift library that provides an implementation of ERC-4337 for Account Abstraction. - It leverages a precompiled Rust library to deliver enhanced performance and security for managing Ethereum accounts. - DESC + s.description = '4337 implementation ' s.homepage = 'https://reown.com' s.license = { :type => 'MIT', :file => 'LICENSE' } - s.authors = { 'Reown, Inc.' => 'contact@reown.com' } + s.authors = 'Reown, Inc.' - # Use your Git repository as the source for the podspec s.source = { :git => 'https://github.com/reown-com/yttrium.git', :tag => s.version.to_s } s.platform = :ios, '13.0' @@ -20,16 +16,12 @@ Pod::Spec.new do |s| # Include the Swift source files s.source_files = 'crates/ffi/YttriumCore/Sources/YttriumCore/**/*.{swift,h}' - # Remove the exclude_files directive (since the .xcframework isn't in your repo) - # s.exclude_files = 'crates/ffi/YttriumCore/RustXcframework.xcframework' + # Include the vendored framework + s.prepare_command = <<-SCRIPT + curl -L -o RustXcframework.xcframework.zip 'https://github.com/reown-com/yttrium/releases/download/0.0.0/RustXcframework.xcframework.zip' + unzip -o RustXcframework.xcframework.zip -d crates/ffi/YttriumCore/ + rm RustXcframework.xcframework.zip + SCRIPT - # Since the framework isn't included in the repo, we need to download it -s.prepare_command = <<-SCRIPT - curl -L -o RustXcframework.xcframework.zip 'https://github.com/reown-com/yttrium/releases/download/0.1.0/RustXcframework.xcframework.zip' - unzip -o RustXcframework.xcframework.zip -d crates/ffi/YttriumCore/ - rm RustXcframework.xcframework.zip -SCRIPT - - # Now specify the path to the downloaded .xcframework s.vendored_frameworks = 'crates/ffi/YttriumCore/RustXcframework.xcframework' end