I'm used to working with web developers, so I know how they set up their pipelines. But now I'm teaming up with a developer who wants to deploy their macOS apps using GitLab CI, and I'm a bit confused. Don't they typically write their code on a Mac? What are the ways to deploy the code to another Mac besides using a .tar or .pkg file? I'm also unsure how local testing fits into their workflow. I want to help but I don't want to steer them wrong—so far, my ideas are limited to either local testing or possibly using a Docker image that acts like macOS, which I've heard isn't really feasible. Can anyone shed some light on this?
5 Answers
If you want to deploy code using GitLab CI, you can set up a macOS agent on a machine you control. Just install a GitLab runner on macOS, and you can run CI jobs there. It's quite similar to how you'd handle other platforms!
For testing and deployment, macOS has a built-in virtualization layer called Virtualization.Framework. You can use tools like Tart to create lightweight VMs. This way, you can install your app in the VM, test it out, and then delete the VM after you're done. It's super handy!
Definitely ask your developer why local testing isn’t feasible for them. Understanding their specific needs is key to creating an effective implementation plan.
Check out MacStadium; it's a service that provides macOS cloud hosting. It can be a good solution for CI/CD with Macs without needing physical hardware.
Apple has its ecosystem set up where developers write their code in Xcode on a Mac. They can release test versions through TestFlight for testers to try out the latest builds. Final versions usually go to the App Store or are distributed as .dmg or .pkg files. Even though everything is developed locally, using a CI pipeline for things like dependency management can be beneficial. GitLab offers MacOS runners, though they can be pricey, or you might consider getting a Mac mini as a build server.
Just a heads up, though, there’s a limit of 2 VMs per physical machine unless you decide to tweak the kernel, which can be complicated.