-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CocoaPods and Swift 5.7 #56
CocoaPods and Swift 5.7 #56
Conversation
Cool. I appreciate that you kept the import structure unchanged. I'll get around to it sometime next week or so. |
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've read your pull request, and I appreciate the time took to support CocoaPods and add GitHub actions—that's great. It is a bit complicated, but only because #if available(...)
does not exist. I took some notes for future reference:
Assumptions
- modules and xcschemes
- the version tag is prefixed by
v
- the podspec variable is called
s
- Package.swift contains
let withStaticBigInt = true|false
- COCOAPODS_TRUNK_TOKEN, SBI, NBK_FEATURE_StaticBigInt
Requirements
- this repository needs a COCOAPODS_TRUNK_TOKEN secret
Files: pods/*
- sets the SBI flag based on the NBK_FEATURE_StaticBigInt environment variable
Files: .github/workflows/test.yml
- tests with or without NBK_FEATURE_StaticBigInt depending on
Xcode
version (macOS
) - tests with or without NBK_FEATURE_StaticBigInt depending on
Swift
version (Linux
)
Files: .github/workflows/deploy.yml
- assigns podspec version based on GitHub release tag name
- creates NBK_FEATURE_StaticBigInt from
let withStaticBigInt = true|false
in Package.swift - pushes 'Numberick', 'Numberick-CoreKit' and 'Numberick-DoubleWidthKit' to
cocoapods.org
It also changes |
I merged it into |
Do you know if you I can pass compiler flags to
Edit: I think I found the solution:
|
Never-mind, the SBI command-line flag only works when the correct platforms are added to Package.swift, otherwise the build fails because StaticBigInt requires macOS 13.3, etc. Hm. Is it even possible to do without regex? Package.swift does not respect command-line flags. does not make this easy. Edit: I can get it to work with #if SBI && swift(>=5.8)
@available(iOS 16.4, macCatalyst 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4, *)
#endif These make NBKDoubleWidth things unavailable prior to iOS 16.4, etc, when SBI is set. |
CocoaPods GitHub action workflow will need the COCOAPODS_TRUNK_TOKEN secret variable in the repository. How to obtain it: https://fuller.li/posts/automated-cocoapods-releases-with-ci/