8 years ago

Install the last Carthage version on CI services (Travis, Circle, ...)

I’ve lately been working with multiple libraries and integrating them with CI, in particular Travis-CI because these libraries are Open Source. These libraries have dependencies that are resolved and built using Carthage which is distributed through Github Releases and Brew. However, the version in brew does not always match the last version available on Github Releases and your CI providers don’t offer the last version either. What can you do then?. Get the last version from Github and install it with a very simple script, how?:

gist:pepibumur/3e088a936b9b03359af1

Use that bash script passing as argument the version of Carthage that you want to install. It’ll download the last .pkg available and install it. For example, if we wanted to use it in our .travis.yml script:

language: objective-c
notifications:
  email: false
xcode_project: SugarRecord.xcodeproj
osx_image: xcode7.2
before_install:
  - bash update_carthage.sh 0.11

Short but useful! Enjoy coding

About Pedro Piñera

I created XcodeProj and Tuist, and co-founded Tuist Cloud. My work is trusted by companies like Adidas, American Express, and Etsy. I enjoy building delightful tools for developers and open-source communities.