DEV Community

mohamed shaban
mohamed shaban

Posted on

How to automate continues deployment for iOS App using FastLane and GitLab Runner

Alt Text
First, let’s say we have a Branch called Staging we want to upload a new build to the App Store Connect when code is pushed to Staging Branch.

You Should First Setup Fastlane and Gitlab Runner Then assign that runner to your GitLab Project.

You Should also Setup Fastlane match action for ensuring that the app is signed before uploading.
in our Fast file, we will add a lane responsible for archiving and uploading a build to the App Store Connect. This lane takes two parameters target and identifier.

  1. First, we are setting environment variable DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS for fixing Firewall Issues that you may face More Details.

  2. Then we are building the project and generate IPA using GYM you can check all its parameters.

  3. Then uploading this IPA using PILOT action you can check all its parameters.

in our .gitlab-ci.yml we will call this lane when code is pushed to Staging Branch

Don’t forget to replace your target name, your App ID (Bundle ID) and your registered runner tag.

Explanation:
we just add one stage for our pipeline it’s called deploy you can add more like a test, lint, build whatever you need to call. Then our deploy stage will run when code only pushed to a branch called staging. our scripts will first run match to ensure Appstore distribution certificates are set. Then we are run the lane that we added to Fast File and passing its parameters.

Latest comments (0)