Build macOS app

I am trying to build an MacOS application using GitLab CI, but the build is failing everytime.

Here’s the configuration for mac job.

image: node:11.14.0
mac:
stage: test
  cache:
    paths:
      - .electron-vue/
      - ~/.yarn
    policy: pull
  artifacts:
    paths:
     - dist/
  script: 
    - yarn
    - yarn build:mac

and here’s the link to electron-builder for mac https://www.electron.build/multi-platform-build#macos

How is it failing? And, what runner are you using?

If I am not wrong, I think to build MacOS application it requires MacOS environment only and by default GitLab CI uses Ubuntu.

image

I am using shared-runners-manager-6.gitlab.com (#380987)

You will need to install a GitLab Runner on a mac (instructions at https://docs.gitlab.com/runner/install/osx.html) and register it to your project (https://docs.gitlab.com/runner/register/index.html). You can register a private runner to a project on gitlab.com or wherever the GitLab server is running. The runner needs to have access to the build tools like XCode and an apple piece of hardware to be able to do it’s work. I have one running on my Mac:
Steves-MBP-3:~ steevo$ gitlab-runner status
Runtime platform arch=amd64 os=darwin pid=16087 revision=8bb608ff version=11.7.0
gitlab-runner: Service is running!
Steves-MBP-3:~ steevo$

But I don’t have mac, is there any other way we can configure the GitLab CI.

Mac is a proprietary system so you have to have paid licenses to use it. The linux runners we have are enabled because the linux container is free. There is discussion about us having Mac and Windows runners for gitlab.com but they would be have a cost associated with them, and it’s not something that’s currently on the roadmap.

I love Gitlab and there is so much potential but this is very sad and disheartening to hear that it is not even on the roadmap. We are forced to use any of your competitors like CircleCI, TravisCI, and SemaphoreCI whom all have this capability for years already.

Checkmate guys… https://github.com/features/actions

As Steve pointed out, mac builds are not possible on Linux out of the box. However, there is another option w/ GitLab for MacOSX builds via MacStadium. I noticed on MacStadium’s page, that they list GitHub as a customer.

Hope this helps!

Our infrastructure team is currently working to make shared macOS runners available, with details and progress found on this issue:

The difficulties in offering this feature are outlined here, with the latest progress/status update here.

Pricing discussion can be found here:

@davidsiu Thank you for your feedback. Please feel free to contribute to the conversation or subscribe for updates on these issues.

If you do not want to wait for shared macOS runners to be made available, one can currently Install and Register a macOS GitLab Runner to get started with macOS app builds right away. I believe ‘bring-your-own’ macOS runners are currently supported on both GitLab.com and self-managed instances.

@mittalyashu If you don’t have genuine Apple hardware available, MacStadium has macOS hardware available for rent that can be used to run your builds jobs. Services like MacStadium are used behind the scenes for a number of CI/CD SaaS platforms that currently offer this functionality.
If you go this route, you’ll likely find this helpful:

1 Like