-
Notifications
You must be signed in to change notification settings - Fork 2
Setup for CocoaPods and SPM distribution #5
Conversation
#### Development Builds | ||
```ruby | ||
# Reference a commit hash | ||
pod 'WooCommerceShared', git: 'https://github.com/woocommerce/WooCommerce-Shared.git', commit: '6cba1e9' | ||
|
||
# Reference a branch | ||
pod 'WooCommerceShared', git: 'https://github.com/woocommerce/WooCommerce-Shared.git', branch: 'trunk' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this CocoaPod uses pre-built binaries, referencing a commit or a branch might not result in the binary that's downloaded reflecting the state of the source code.
echo "--- :amazon-s3: Uploading" | ||
GIT_HASH=$(git rev-parse --short HEAD) | ||
aws s3 cp dist/WooCommerceShared.xcframework.zip s3://a8c-apps-public-artifacts/woocommerce-shared/${GIT_HASH}/WooCommerceShared.xcframework.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started building an upload_to_s3
command in the CI toolkit, but I half regret it now... There's really little difference than calling aws
directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkmassel I run into various issue recently while working on the Gutenberg XCFramework with CocoaPods, and it looks like this setup is experiencing similar problems as the podspec
doesn't pass validation:
![image](https://private-user-images.githubusercontent.com/1218433/240459468-e117f74c-effb-4836-8d80-37d9bced305e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNjExMjIsIm5iZiI6MTczOTI2MDgyMiwicGF0aCI6Ii8xMjE4NDMzLzI0MDQ1OTQ2OC1lMTE3Zjc0Yy1lZmZiLTQ4MzYtOGQ4MC0zN2Q5YmNlZDMwNWUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMDgwMDIyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MzAyZDRjNDJhMThmOTc2MTQwOTAwNTI5OGEyNGRiYTcxMDgxOWYwZTQwODhhNzJlYTBjODZkZWQ5ODhlYjU4YyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.INVvC6UjVo69hEhoQRGx1zdNTy555FWqlI07gE300dw)
Unfortunately, I haven't been able to get my Gutenberg setup to work yet. I am working around it by downloading and unpacking the archive and using a local podspec that refers to the files on my system. See wordpress-mobile/WordPress-iOS#20717
Add RuboCop configuration file and address violations
0bff291
to
cd13050
Compare
Ok, so weirdly enough 42fbf15 works, but it's...kinda gross. For some reason the I'm not sure what I'm missing – I know the I think this approach proves the concept, but I might have to dig into CocoaPods internals to figure out the |
That's the same conclusion I got to 😞 I started looking into |
@Ecarrion – sorry about the wait – this is ready. CocoaPods is still a bit of a mess (we can make it build fine if we reference the Git repo, but we can't push to a public Pod until we figure out why it doesn't properly support Fortunately, WCiOS seems to already heavily use SwiftPM, and that works fine. The release process is a little weird, but I've added it to Please try adding this repo to the project using SwiftPM, and choose the /cc @shiki |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkmassel the SPM version seems to work fine on the WCiOS app. Thanks!
Can I( or you?) release the latest trunk as a new version to do a more comprehensive test? 😁
Adds instructions on how to use the library, as well as the Podspec and Package.swift that make it work.
Doesn't yet publish the package to CocoaPods.
SwiftPM only allows packages to be distributed as ZIP files, so this PR adjusts that.