GitHub Actions Integration

Use GitHub Actions runner running on a macOS machine to build using fastlane.

Repository setup

First create a Gemfile in the root of your project with the following content:

source 'https://rubygems.org'

gem 'fastlane'

Add a workflow yaml file to your repository. For example, if naming your workflow "build-ios-app", add .github/workflows/build-ios-app.yml with the following content:

name: build-ios-app
on:
  push:
    branches:
      - 'master'
jobs:
  build:
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v2
      - run: fastlane beta
        env:
          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}

See Workflow syntax for GitHub Actions for more information on how this file works.

Setting up the lanes

Here's an example of a Fastfile with a lane that runs match, builds the app, and uploads to TestFlight:

platform :ios do
  lane :beta do
    setup_ci if ENV['CI']
    match(type: 'appstore')
    build_app
    upload_to_testflight(skip_waiting_for_build_processing: true)
  end
end

Note the usage of setup_ci: it creates a temporary keychain. Without this, the build could freeze and never finish.