How to auto upload build to TestFlight with fastlane

I’m using fastlane to upload ipa to TestFlight in my local machine, but I want to be able to do this on circleci too, but I don’t sure how circle.yml will look like, and don’t know how should I put my certificate things.

If anyone be able to guide me on how to do this it would really help.

My local lane is something like

sigh
gym(scheme: "my-scheme-name")
pilot
1 Like

Hello @sarunw

I am also trying to do that. I am able to upload my build from CircleCI to Testflight but I am getting the error on TestFlight “Missing Beta Entitlement”.
I included my provision profile file in the root of the repositiory.

Circle.yml file

machine:

  environment:
    GYM_CODE_SIGNING_IDENTITY: "iPhone Distribution: My Organization (xxxxxxxxxxx)"

  xcode:
    version: "8.0"

test:
  override:
    - set -o pipefail && xcodebuild -workspace 'my.xcworkspace' -scheme 'myScheme' clean build test -sdk iphonesimulator -destination 'id=AC291080-8EFE-4095-8C55-B1E952EFFC36' CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=  PROVISIONING_PROFILE=

dependencies:
  pre:
    - gem update fastlane

deployment:
  beta_distribution:
    branch: master
    commands:
      - fastlane beta

Fastfile

# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/fastlane/docs
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
# can also be listed using the `fastlane actions` command

# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`

# If you want to automatically update fastlane if a new version is available:
# update_fastlane

# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "1.108.0"

default_platform :ios

platform :ios do
  before_all do
    # ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
    #cocoapods
    
  end

  desc "Runs all the tests"
  lane :test do
    scan
  end

  desc "Submit a new Beta Build to Apple TestFlight"
  desc "This will also make sure the profile is up to date"
  lane :beta do    
    #cert
    #sigh
    increment_build_number    
    gym(scheme: "jamesAppV2”) # Build your app - more options available
	

    pilot                    # upload your app to TestFlight
    #slack(message: "Successfully distributed a new beta build")

    # sh "your_script.sh"
    # You can also use other beta testing services here (run `fastlane actions`)
  end

  desc "Deploy a new version to the App Store"
  lane :release do
    # match(type: "appstore")
    # snapshot
    gym(scheme: "myScheme") # Build your app - more options available
    deliver(force: true)
    # frameit
  end

  # You can define as many lanes as you want

  after_all do |lane|
    # This block is called, only if the executed lane was successful

    # slack(
    #   message: "Successfully deployed new App Update."
    # )
  end

  error do |lane, exception|
    # slack(
    #   message: exception.message,
    #   success: false
    # )
  end
end


# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md

# fastlane reports which actions are used
# No personal data is recorded. Learn more at https://github.com/fastlane/enhancer