Skip to content

Commit

Permalink
add steps in release swift
Browse files Browse the repository at this point in the history
  • Loading branch information
llbartekll committed Oct 14, 2024
1 parent 60dd090 commit 0df8095
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 18 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/release-swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
26 changes: 9 additions & 17 deletions YttriumWrapper.podspec
Original file line number Diff line number Diff line change
@@ -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.' => '[email protected]' }
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'
Expand All @@ -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

0 comments on commit 0df8095

Please sign in to comment.