CocoaPods served us very well for long years. It is an absolutely great package manager that is both convenient and robust enough to support very complex build pipelines that go well beyond regular iOS/macOS/tvOS development (like OpenCV2 C++ library, etc). It is so robust that it took Swift Package Manager more than 3 years to fill the gap between the two. Finally, with Xcode 12 and Swift 5.3 toolchain we are receiving long-awaited support for resources, binary packages and robust build settings for SwiftPM. Those additions are going to become major enablers for folks to convert their Pods into Packages.

Why you should convert your Pods into Packages

SwiftPM is also going to bring a lot of neat things like static linkage by default and dedicated bundles for framework resources, so one should definitely consider migrating from CocoaPods to SwiftPM as it can make your app faster, smaller and also provide some nice code-generated things in your code, like Bundle.module. …


Image for post

In this article we are going to quickly cover a trivial GitHub Actions setup I use for my open source Metal library Alloy to automatically publish new versions into CocoaPods trunk register.

First, we will need to grab a registration token from CocoaPods. You can get it by using the pod trunk register command.

pod trunk register your@email.com -- description "GitHub Actions Token"

You will receive an e-mail with a confirmation link to confirm you are the owner of that e-mail. Once you’ve confirmed the token you can obtain it from private files using the following command:

grep -A2 'trunk.cocoapods.org' ~/.netrc …

About

Andrey Volodin

Professionally bad at UIKit. Leading mobile development at @PrismaAI . ex @cocos2d

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store