home / skills / willsigmon / sigstack / fastlane-expert

fastlane-expert skill

/plugins/ios-dev/skills/fastlane-expert

This skill automates iOS builds, testing, and deployments using fastlane to streamline TestFlight and App Store releases.

npx playbooks add skill willsigmon/sigstack --skill fastlane-expert

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.2 KB
---
name: Fastlane Expert
description: Fastlane automation - build, test, deploy iOS apps, TestFlight, App Store Connect
allowed-tools: Read, Edit, Bash
model: sonnet
---

# Fastlane Automation Expert

Automate iOS builds, testing, and deployment with fastlane.

## Setup

```bash
# Install
brew install fastlane

# Init in project
cd ios-project
fastlane init
```

## Fastfile Patterns

### Beta to TestFlight
```ruby
# Fastfile
default_platform(:ios)

platform :ios do
  desc "Push a new beta build to TestFlight"
  lane :beta do
    increment_build_number(xcodeproj: "App.xcodeproj")
    build_app(scheme: "App")
    upload_to_testflight(
      skip_waiting_for_build_processing: true
    )
  end
end
```

### App Store Release
```ruby
lane :release do
  capture_screenshots
  build_app(scheme: "App")
  upload_to_app_store(
    submit_for_review: true,
    automatic_release: true,
    force: true,
    skip_metadata: false,
    skip_screenshots: false
  )
end
```

### Testing Lane
```ruby
lane :test do
  run_tests(
    scheme: "AppTests",
    devices: ["iPhone 15 Pro"],
    code_coverage: true
  )
end
```

## App Store Connect API

```ruby
# Appfile
app_identifier "com.example.app"
apple_id "[email protected]"
team_id "ABC123"

# API key auth (recommended)
# Store key file securely
lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] = app_store_connect_api_key(
  key_id: "ABC123",
  issuer_id: "def-456",
  key_filepath: "./AuthKey.p8"
)
```

## Code Signing

### Match (Recommended)
```ruby
lane :sync_certs do
  match(
    type: "appstore",
    app_identifier: "com.example.app",
    git_url: "[email protected]:org/certs.git"
  )
end

lane :beta do
  match(type: "appstore")
  build_app(scheme: "App")
  upload_to_testflight
end
```

## CI/CD Integration

### GitHub Actions
```yaml
- name: Build and Upload
  env:
    APP_STORE_CONNECT_API_KEY: ${{ secrets.ASC_KEY }}
    MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
  run: bundle exec fastlane beta
```

## Common Actions
- `build_app`: Build iOS app
- `upload_to_testflight`: Beta distribution
- `upload_to_app_store`: Production release
- `match`: Code signing sync
- `snapshot`: Screenshot automation
- `deliver`: Metadata/screenshots upload

Use when: iOS builds, TestFlight uploads, App Store releases, CI/CD automation

Overview

This skill automates iOS build, test, and release workflows using fastlane. It provides lanes for TestFlight betas, App Store releases, and automated testing, plus guidance for code signing and CI integration. The goal is reliable, repeatable iOS delivery with minimal manual steps.

How this skill works

Define lanes in a Fastfile to run sequences like incrementing build numbers, building the app, running tests, and uploading artifacts to TestFlight or the App Store. Use an Appfile and App Store Connect API keys for authenticated uploads and use match to sync provisioning profiles and certificates. Integrate lanes into CI (for example GitHub Actions) so builds, tests, and releases run automatically on push or tags.

When to use it

  • Push a new beta build to TestFlight for QA or external testers
  • Submit a production binary and metadata to the App Store
  • Run automated unit/UI tests and collect code coverage
  • Automate certificate and provisioning profile syncing across machines
  • Trigger builds and releases from CI pipelines (GitHub Actions, etc.)

Best practices

  • Store App Store Connect API key files securely and inject via CI secrets
  • Use match with a private git repo to centralize code signing artifacts
  • Keep lanes focused (build, test, deploy) and reuse common actions
  • Set skip flags (processing/waiting) in CI to avoid manual pauses
  • Version control Fastfile and Appfile but never commit private keys or passwords

Example use cases

  • Create a beta lane that increments build number, builds the app, and uploads to TestFlight with skip_waiting_for_build_processing
  • Run a test lane on pull requests to validate unit and UI tests on a real device simulator
  • Release lane that captures screenshots, builds, and submits the app for App Store review with automatic_release
  • Sync certificates via match before any build to prevent signing failures on CI workers
  • Invoke fastlane from GitHub Actions using secrets for API keys and match password

FAQ

How do I authenticate uploads to App Store Connect?

Use an App Store Connect API key (AuthKey.p8) with key_id and issuer_id stored as secure CI secrets and referenced by fastlane in the Appfile or lane context.

How do I avoid code signing issues on CI?

Use match to store certificates and profiles in a private git repo and load them in lanes; ensure MATCH_PASSWORD and repo access are provided via CI secrets.