Skip to content

refactor(fastlane): Modularize Fastfile into separate lane files#87

Merged
philprime merged 6 commits intomainfrom
refactor-release-process
Feb 26, 2026
Merged

refactor(fastlane): Modularize Fastfile into separate lane files#87
philprime merged 6 commits intomainfrom
refactor-release-process

Conversation

@philprime
Copy link
Member

Summary

  • Split the 888-line monolithic Fastfile into a modular structure with separate lane files
  • Add custom enable_pr_auto_merge action for GitHub auto-merge via GraphQL API
  • Implement idempotent deploy_beta lane that skips upload if build already exists on TestFlight

Changes

New Structure

fastlane/
├── Fastfile                    # Main entry with imports (46 lines)
├── lanes/
│   ├── build.rb               # build_ci lane
│   ├── release.rb             # beta, prepare_release, deploy_beta, publish
│   ├── utilities.rb           # generate_*, upload_metadata, setup_code_signing, bump_*
│   ├── helpers.rb             # Private helper lanes
│   ├── sentry.rb              # Sentry integration lanes
│   ├── version.rb             # Version management lanes
│   └── git.rb                 # Git and GitHub lanes
└── actions/
    └── enable_pr_auto_merge.rb # Custom action for GitHub auto-merge

Workflow Changes

  • Rename publish-beta-build.ymldeploy-beta.yml
  • Add prepare-release.yml workflow for scheduled/manual releases
  • prepare_release queries TestFlight for next build number upfront
  • deploy_beta checks if build exists before uploading (idempotent, safe to re-run)

Dependencies

  • Add octokit gem for GitHub API interactions

Test Plan

  • bundle exec fastlane lanes shows all 12 public lanes
  • bundle exec fastlane action enable_pr_auto_merge shows custom action docs
  • Test prepare_release workflow manually
  • Test deploy_beta workflow on release branch push

Split the 888-line monolithic Fastfile into a modular structure:

- fastlane/Fastfile: Main entry with imports (46 lines)
- fastlane/lanes/build.rb: build_ci lane
- fastlane/lanes/release.rb: beta, prepare_release, deploy_beta, publish
- fastlane/lanes/utilities.rb: generate_*, upload_metadata, setup_code_signing, bump_*
- fastlane/lanes/helpers.rb: Private helper lanes
- fastlane/lanes/sentry.rb: Sentry integration lanes
- fastlane/lanes/version.rb: Version management lanes
- fastlane/lanes/git.rb: Git and GitHub lanes
- fastlane/actions/enable_pr_auto_merge.rb: Custom action for GitHub auto-merge

Additional changes:
- Add octokit gem for GitHub API interactions
- Rename publish-beta-build.yml to deploy-beta.yml
- Add prepare-release.yml workflow for scheduled releases
- Implement idempotent deploy_beta lane (skips if build already uploaded)
- Query TestFlight for next build number in prepare_release
Copilot AI review requested due to automatic review settings February 2, 2026 10:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors Fastlane configuration by splitting a previously monolithic Fastfile into modular lane files, adds a custom Fastlane action to enable GitHub PR auto-merge, and updates CI workflows to support a prepare-release + deploy-beta flow.

Changes:

  • Modularized Fastlane lanes into fastlane/lanes/*.rb and simplified fastlane/Fastfile imports
  • Added enable_pr_auto_merge custom action using Octokit + GitHub GraphQL API
  • Added prepare-release.yml and updated deploy-beta.yml to support release-branch-driven beta deployments

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
fastlane/Fastfile Replaced monolithic lane definitions with imports for modular lane files.
fastlane/lanes/build.rb Defines build_ci lane for CI archives and optional Sentry upload.
fastlane/lanes/release.rb Adds/defines release lanes: beta, prepare_release, deploy_beta, publish.
fastlane/lanes/utilities.rb Adds utility lanes for icons, screenshots, metadata upload, code signing, and version bump lanes.
fastlane/lanes/helpers.rb Extracts private helper lanes used across build/release workflows.
fastlane/lanes/version.rb Adds private lanes for version/build number coordination with App Store Connect/TestFlight.
fastlane/lanes/sentry.rb Adds private lanes for Sentry release creation/finalization and uploads.
fastlane/lanes/git.rb Adds private lanes for PR creation, tagging, and invoking auto-merge action.
fastlane/actions/enable_pr_auto_merge.rb New custom action to enable PR auto-merge via GraphQL.
Gemfile Adds octokit dependency for GitHub API operations.
Gemfile.lock Locks octokit and its transitive dependencies.
.github/workflows/prepare-release.yml New scheduled/manual workflow to bump version/build and open a release PR.
.github/workflows/deploy-beta.yml Renames/retools workflow to deploy beta on release/** pushes.
Comments suppressed due to low confidence (1)

.github/workflows/deploy-beta.yml:10

  • github.job.name is not a valid GitHub Actions context property; the job id is available as github.job. As written, this expression may evaluate unexpectedly (or to an empty string), which can cause unrelated runs to share the same concurrency group. Consider switching to ${{ github.job }} (or remove the job component if you intentionally want a workflow-wide lock).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Run release preparation, TestFlight deployment, and main+tag push in one workflow
using the release bot token, and consolidate Fastlane lane descriptions.
Normalize and validate merge_method against GitHub's allowed enum values
before interpolating into the GraphQL mutation to prevent invalid requests.
@philprime
Copy link
Member Author

Addressed the high-priority feedback about GraphQL enum interpolation in in commit .

is now normalized and validated against an allowlist (, , ) before being interpolated into the GraphQL mutation.

Drop the unused PR/auto-merge lanes and action after moving to the
single release_beta_ci workflow, and remove octokit dependency.
Call _setup_code_signing before _build_app_for_store in publish so
manual signing profiles are available during archive export.
@philprime philprime enabled auto-merge (squash) February 26, 2026 18:42
@philprime philprime merged commit 74052dd into main Feb 26, 2026
5 checks passed
@philprime philprime deleted the refactor-release-process branch February 26, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants