Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Credentials used in tests
ALGOLIA_APPLICATION_ID_1=
ALGOLIA_ADMIN_KEY_1=
18 changes: 17 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,23 @@ These changes will be then pushed in a pull request, ready to be merged.

#### CocoaPods specifics

While both Swift Package Manager and Carthage rely on GitHub and git tags to retrieve the library, CocoaPods has its own repository. If for any reason the deployment fails at the `pod_push` step, InstantSearch iOS can be published to CocoaPods manually from an authorized user.
While both Swift Package Manager and Carthage rely on GitHub and git tags to retrieve the library, CocoaPods has its own repository.

[Since Xcode 14.3](https://github.com/CocoaPods/CocoaPods/issues/11839), the deployment fails at the `pod_push` step, requiring the library to be manually published to the CocoaPods repository. The Fastlane deploy does not include this step anymore.

InstantSearch iOS should be published to CocoaPods manually from an authorized user's local environment. Xcode 14.2 cannot be used to build as it's incompatible with macOS Sonoma and up, but it's possible to [copy some of its files](https://github.com/CocoaPods/CocoaPods/issues/12033#issuecomment-2172608443) that are mistakenly required by CocoaPods for Podfile validation:

```bash
# Install Xcode 14.2 (here, using xcodes CLI)
xcodes install 14.2

# Copy required files
sudo cp /Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc
```

In the meantime, [merge the deploy PR](https://github.com/algolia/instantsearch-ios/pulls) generated by the pipeline and pull it into your local repository.

Finally, register or authenticate with CocoaPods, and publish the new version manually.

**Registering a user** with CocoaPods:

Expand Down
34 changes: 19 additions & 15 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ lane :deploy do |options|
base_branch = options[:branch] || "master"

# ensure branch and cleanliness locally but not on Bitrise.
if !ENV['GITHUB_ACTION']
if !ENV['GITHUB_ACTION']
ensure_git_branch(
branch: base_branch
)
Expand Down Expand Up @@ -114,13 +114,15 @@ lane :deploy do |options|
sh("git tag -d #{release_type}; git push --delete origin #{release_type}")
end

pod_push(
path: podspec_path,
allow_warnings: true
)
# Disabled, manual CocoaPods release required.
# See CONTRIBUTING.md for more information.
# pod_push(
# path: podspec_path,
# allow_warnings: true
# )
end

lane :deployBeta do |options|
lane :deployBeta do |options|
branch = options[:branch] || "master"

pod_lib_lint(
Expand Down Expand Up @@ -149,10 +151,12 @@ lane :deployBeta do |options|
)
push_to_git_remote(remote: "origin")

pod_push(
path: "InstantSearch.podspec",
allow_warnings: true
)
# Disabled, manual CocoaPods release required.
# See CONTRIBUTING.md for more information.
# pod_push(
# path: "InstantSearch.podspec",
# allow_warnings: true
# )

end

Expand All @@ -164,14 +168,14 @@ def prepare_git(branch)
# ensure_git_branch(branch:branch)
masterHash = sh("git rev-parse origin/#{branch}")
headHash = sh("git rev-parse HEAD")
if masterHash != headHash

if masterHash != headHash
raise "Error: Master and Head Hashes do not match, meaning that we are probably not on Master and therefore can't deploy"
end

# checkout master to be able to push tag there.
sh("git checkout #{branch}")

# We already pull in bitrise before doing anything, so no need for this step anymore.
# git_pull
end
Expand All @@ -183,7 +187,7 @@ def prepare_api_keys()
if api_key
xcargs << %Q[ALGOLIA_API_KEY="#{api_key}"]
end

api_id = ENV["ALGOLIA_APPLICATION_ID"]
if api_id
xcargs << %Q[ALGOLIA_APPLICATION_ID="#{api_id}"]
Expand All @@ -193,7 +197,7 @@ def prepare_api_keys()
if places_api_id
xcargs << %Q[PLACES_APPLICATION_ID="#{places_api_id}"]
end

places_api_key = ENV["PLACES_API_KEY"]
if places_api_key
xcargs << %Q[PLACES_API_KEY="#{places_api_key}"]
Expand Down