What this guide covers
When you finish, the repository's workflows can send jobs to this Mac, and the runner stays online after you disconnect the remote desktop. You need: admin access to the repository, and a remote Mac with Xcode and your other build tools installed.
Steps
Check the network requirement first: outbound only
GitHub's self-hosted runner reference states the network requirement like this: the host must be able to make outbound HTTPS connections over port 443, and the runner connects to GitHub to receive job assignments. What the document lists are domains the machine must be able to reach; it does not require connecting into the machine from outside.
So this does not need a port mapped to the outside or any change to the machine's network configuration, neither of which is allowed on a rented machine anyway. The public exit may be shared with other machines; that makes no difference to the runner.
Add the runner on GitHub
Following the adding runners documentation: go to the repository's Settings, choose Actions > Runners in the left sidebar, click New self-hosted runner, and select the operating system and architecture. The page gives a set of commands to run on the machine in order: download, extract, run the configuration script.
The registration token the configuration script uses is time-limited; if it expires, go back to the page and generate a new one. Keep the runner directory under your own user directory.
Run it once in the foreground first
After configuration, run the runner program directly. When Terminal shows "Listening for Jobs", it is connected to GitHub. Push a minimal workflow to try it:
jobs: build: runs-on: [self-hosted, macOS] steps: - run: xcodebuild -versionruns-onmatches runners by label; in the documentation's example a runner is selected only when all the labels match. Once you have confirmed it runs, stop the foreground process.Install as a service
Following the configuring the application as a service documentation, run in the runner directory:
./svc.sh install ./svc.sh start ./svc.sh statusNone of the commands in the macOS section need elevated privileges, and the service is based on launchd. Stopping and uninstalling are
./svc.sh stopand./svc.sh uninstall. Run these commands in the Terminal app on the remote desktop.Come back and check after a restart
Whether the service recovers by itself after the machine restarts depends on whether your account is logged in. Automatic login on a rented machine has to be assessed by support first; do not change login or disk encryption settings yourself.
So after every restart (use the restart option in the customer console; do not shut down), connect to the desktop and confirm with
./svc.sh statusthat the runner is online. Jobs do not fail because the runner is offline. They just stay queued, and that produces no failure notification.Use it for private repositories only
GitHub's documentation recommends using self-hosted runners only with private repositories: forks of a public repository can run code on your runner through pull requests. This machine holds your signing certificates and assorted credentials, so the advice matters all the more here.
For the same reason, do not lend the runner to someone else's repositories. Lending the device or sharing access with third parties is not permitted either.
Updates, cleanup and ending the rental
According to the documentation, the runner updates itself automatically by default. Unlike GitHub-hosted runners, a self-hosted machine is not restored to a clean environment after each job, and updating the operating system and other software is your responsibility; contact support before a system upgrade. Clean the working directory and caches regularly.
Before the rental ends: open this runner on the repository's Runners page, choose Remove, and run the command the page gives you on the machine. The removing runners documentation says this removes the runner from GitHub and deletes the local configuration and service. If the machine can no longer be reached, use the force remove option on the page.
FAQ
Why does my job stay queued and never run?
First see whether this runner is online on the repository's Runners page, then check that the labels in the workflow's runs-on all match the runner's labels. If it is offline, connect to the machine and check the service status.
Can one machine register more than one runner?
You can configure one in each of several directories, but parallel jobs compete for CPU, memory and Xcode's cache directories. How many can run in parallel depends on the project and the configuration; we have no measured figures.
How do I choose between this and the macOS runners GitHub provides?
Those are billed by usage and give a fresh environment every time. Self-hosted is a fixed cost with an environment that persists. For the structural differences, see remote Mac or cloud build service; for prices, see the plans page.
Can the platform see what I build?
The platform runs the operational and security monitoring it needs (processes, network connections, configuration state) and does not record screen contents or the content of your business data. Process arguments can reveal hints about a project, so for confidential projects check your own organization's requirements first.
Related
- Rented Mac mini as an always-on build machine for small teams? Count your build minutes first
- Remote Mac vs GitHub Actions macOS runner or Codemagic: which should I use?
- How to keep long tasks running on a remote Mac mini after you disconnect
- Code signing hangs on a CI Mac: unlock the keychain or use a dedicated one
- Self-hosted Mac CI build cache: what to keep and what to clear every time
Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support