Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds support for distribution through CocoaPods.
LyticsSDK
I chose this as Lytics is already taken, but I am open to any alternative name.LyticsUI
I used separate podspecs rather than subspecs as the latter generates a single target for the different subspecs rather than separate
Lytics
andLyticsUI
targets.Attention should be paid to my choice of values for the different settings like
s.homepage
ands.social_media_url
.The next PR will include changes to the
tag-release
workflow to automate publishing the podspecs. I am submitting that separately to ensure that any potential CI issues do not disrupt other work that depends on the published podspecs.Post-Merge Configuration
Once this PR is merged and tagged -- this tag will need to be created manually rather than with the Release workflow if we use
0.0.1
-- the podspecs will need to be published to the CocoaPods ‘Trunk’ web-service. As this involves a claim of ownership it should be performed by someone from Lytics. The process to do this is as follows:Install CocoaPods:
The documentation suggests installing CocoaPods using gem; if using the default Ruby install on macOS you will need to use
sudo
when installing:Alternatively, it is available through homebrew (
brew install cocoapods
).Create Account
Documentation: Getting setup with Trunk
Register for an account:
Trunk accounts do not have passwords, only per-computer session tokens; you must click a link in an email Trunk sends you to verify the connection between your Trunk account and the current computer. Note that when I tried this on 2023/10/02 I saw erroneous error messages on the verification page. After clicking the link in the email verify your session by running
pod trunk me
.Publish Specs
The podspecs use the
LIB_VERSION
environment variable for the version number, so set that first (using whatever version number we use; a normal rather than pre-release version number would be preferable):Publish the core spec by running the following from the repo's root directory:
Then, publish the UI spec:
Obtain Cocoapods Token
Get the token for an account session for use with GitHub actions; you can separate the CI session from the one created above by first running
pod trunk register
to create a new one.The results should look like:
Then, add the token as the value for the
COCOAPODS_TRUNK_TOKEN
secret in the repo's settings (the secret has already been created with a placeholder value).