Issue 22
Sponsored
No more cat-herding, spreadsheets, or steady drip of manual busywork. Runway helps your team level up your release coordination and automation, from kickoff to release to rollout.
Hey everyone! 👋 Welcome to the twenty-second issue of the iOS CI Newsletter. Hope you’ve had a great couple of weeks!
Over the past few weeks, I have been asked by numerous people whether my most-read articles tweets, which round up the three posts with the most unique visitors on my blog, are automated or not.
The truth is that they used to be but they no longer are and today I’ll tell you why that is the case and what I am doing to automate them again 😅.
How it started
I initially implemented the automation as a scheduled GitHub Actions workflow that would run every Friday at noon and invoke a Swift CLI.
In turn, the Swift CLI would then make a network request to my blog’s analytics provider to get the week’s most read articles, format the response into a tweetable string and communicate with Twitter’s API to post the results to my profile.
While this approach was simple, it stopped working pretty soon. Due to inactivity in the repository (it only existed to run the workflow), GitHub Actions decided to turn all workflows off after 60 days, breaking my automation 😭.
How it’s going
I could have fixed the issue by having the workflow commit some code back to the repository but that didn’t feel like the right solution and I wanted something scalable that worked long-term.
After doing some research, I decided to start migrating the CLI code into a Swift AWS lambda which would run on a schedule, much like the GitHub Actions workflow did.
I have not yet finished the implementation but I have written an initial article on how you can set up scheduled Swift AWS lambdas and, over the next few weeks, I will be sharing how I get on with the rest of the migration! 🎉
🔁 Chxcode: a tool to easily manage Xcode versions
A couple of weeks ago, and thanks to a Mastodon thread 🐘, I came across an awesome tool built by Klaas Pieter Annema that allows you to switch between multiple versions of Xcode directly from the command line.
This tool is coming in particularly handy for me this time of year as I have multiple stable and beta releases of Xcode installed on my machine and I constantly find myself switching between them 👏.
💡 If you’re interested in other cool solutions to the same problem, there is an amazing article on using keyboard shortcuts to smartly open the correct version of Xcode by Christian Selig and a ruby script you can use directly from your Fastfile by Wolfgang Lutz.
🎉 GitHub’s CodeQL and Dependabot now support Swift
GitHub recently announced that both CodeQL and Dependabot have now added support for Swift. You can now use these tools to get security alerts, detect vulnerabilities and automatically update out-of-date dependencies on Swift projects.
I would thoroughly recommend reading this article by Marco Eidinger as he goes through everything you need to know about these tools and how you start using them now!
🔨 Create Pull Requests automatically using Fastlane
I really enjoyed reading this article by Manuel Herrera on how to write a Fastlane lane to create Pull Requests directly from the command line.
The lane has a lot of functionality built in and makes creating comprehensive and great-looking Pull Requests a breeze!
📸 Automatic screenshot generation with Fastlane
While often overlooked, I personally believe that the snapshot action is one of Fastlane’s most powerful and time-saving features for developers as it can automatically take screenshots of your mobile application.
In this article, Natascha Fadeeva goes through how snapshot works and what some of its use cases are.
🚨 CloudWatch dashboards and alarms on Mac instances
I am really enjoying all of Alberto de Bortoli’s AWS-themed articles recently.
This time Alberto provides a great explanation of the not-trivial and documentation-lacking process of setting up CloudWatch on Mac EC2 instances 👏.