In this repository the main
branch contains the latest development version of the Ably SDK. All development (bug fixing, feature implementation, etc.) is done against the main
branch, which you should branch from whenever you'd like to make modifications. Here's the steps to follow when contributing to this repository.
- Fork it
- Install Carthage:
brew install carthage
- Install gems:
bundle install
- Setup or update your machine by running
make update
- Create your feature branch from
main
(git checkout main && git checkout -b my-new-feature-branch
) - Commit your changes (
git commit -am 'Add some feature'
) - Ensure you have added suitable tests and the test suite is passing
- Push to the branch (
git push origin my-new-feature-branch
) - Create a new Pull Request
Releases of the Ably SDK built by the sources in this repository are tagged with their semantic version numbers.
When you first clone the repository then you will need to run make update
in order to
bring in Git submodules and Carthage dependencies.
Code can then be modified, built and tested by loading Ably.xcodeproj in your Xcode IDE.
The Xcode project relies upon dependencies resolved by Carthage.
If you make changes to the Cartfile then you will need to run make update_carthage_dependencies
from the command line and then do a clean rebuild in Xcode.
Changes made to dependencies in the Cartfile need to be reflected in Ably.podspec and vice-versa.
These are the header files that form the public interface of the SDK.
- Put
.h
file in directorySource/include/Ably
. - Add
#import
to umbrella headerSource/include/Ably/Ably.h
. - Add to the Xcode project
Ably.xcodeproj
— you need to add it as a Public header to all three SDK targets (Ably-iOS, Ably-macOS, Ably-tvOS).
These are the header files that form the internal interface of the SDK.
- Put
.h
file in directorySource/PrivateHeaders/Ably
. - Add
header
declaration to thePrivate
module in module map filesSource/include/Ably.modulemap
andSource/Ably.modulemap
. - Add to the Xcode project
Ably.xcodeproj
— you need to add it as a Private header to all three SDK targets (Ably-iOS, Ably-macOS, Ably-tvOS).
- Put
.m
file in directorySource
. - Add to the Xcode project
Ably.xcodeproj
— you need to add it to all three SDK targets (Ably-iOS, Ably-macOS, Ably-tvOS).
To run tests use make test_[iOS|tvOS|macOS]
. These tests expect you to have a simulator device of a specific model and OS version. See Fastfile
for these values. If you don’t have a matching simulator, you can create one using simctl
. For example, xcrun simctl create "iPhone 12 (14.4)" "iPhone 12" "com.apple.CoreSimulator.SimRuntime.iOS-14-4"
.
For each release, the following needs to be done:
- Create a new branch
release/x.x.x
(wherex.x.x
is the new version number) from themain
branch - Run
make bump_[major|minor|patch]
to bump the new version number. This will create a Git commit, push it to origin:git push -u origin release/x.x.x
- Go to Github releases and press the
Draft a new release
button. Choose your new branch as a target - Press the
Choose a tag
dropdown and start typing a new tag, Github will suggest theCreate new tag x.x.x on publish
option. After you select it Github will unveil theGenerate release notes
button - From the newly generated changes remove everything that don't make much sense to the library user
- Copy the final list of changes to the top of the
CHANGELOG.md
file. Modify as necessary to fit the existing format of this file - Commit these changes and push to the origin
git add CHANGELOG.md && git commit -m "Update change log." && git push -u origin release/x.x.x
- Make a pull request against
main
and await approval of reviewer(s) - Once approved and/or any additional commits have been added, merge the PR (f you do this from Github's web interface then use the "Rebase and merge" option)
- After merging the PR, wait for all CI jobs for
main
to pass. - If any fixes are needed (e.g. the lint fails with warnings) then either commit them to the
main
branch now (don't forget to pull the changes firstgit checkout main && git pull
) if they are simple warning fixes or perhaps consider raising a new PR if they are complex or likely need a review. - Publish your drafted release:
- refer to previous releases for release notes format
- attach to the release the prebuilt framework file (
Ably.framework.zip
) generated by Carthage – you can find this file in thecarthage-built-framework
artifact uploaded by thecheck-pod
CI workflow
- Checkout
main
locally, pulling in changes usinggit checkout main && git pull
. Make sure the new tag you need was created on publish - Release an update for CocoaPods using
pod trunk push Ably.podspec
. Details on this command, as well as instructions for adding other contributors as maintainers, are at Getting setup with Trunk in the CocoaPods Guides - Test the integration of the library in a Xcode project using Carthage and CocoaPods using the installation guide