[Kickstart] Release iOS App Using Fastlane and Gitlab CI (1/2)

Setup Gitlab Runner

Setup Gitlab CI

stages: // 1 
- unit_tests
- deploy
variables: // 2
LC_ALL: "en_US.UTF-8"
LANG: "en_US.UTF-8"
before_script: // 3
- rbenv global 2.7.1
- gem install bundler
- bundle install

- git remote set-url origin REPLACE_WITH_YOUR_GIT_REPO
- git config --global user.email 'REPLACE_WITH_YOUR_EMAIL'
- git config --global user.name 'REPLACE_WITH_YOUR_USER_NAME'

unit_tests: //4
stage: unit_tests
only: //5
refs:
- develop
- merge_requests
script: // 6
- xcodebuild -workspace TestAPP.xcworkspace -scheme "REPLACE_WITH_YOUR_XCODE_SCHEME_NAME" -sdk iphonesimulator -destination "platform=iOS Simulator,OS=13.6,name=iPhone X," test -enableCodeCoverage YES
tags:
- ios-build
deploying: // 7
stage: deploy
script: // 8
- bundle exec fastlane ios deploy-app branch:develop
tags:
- ios-build
only: //9
refs:
- develop
except: //10
- web
- schedules
when: on_success // 11
  1. those are the names of the stages you want to trigger. you can name them anything you want as long as you will call them on your stage mappings later
  2. here we just pass localization and languages that we support .. usually you don’t need to change that.
  3. that’s an important step. you usually have some scripts you need to execute before the build of the app.. now thats the right place.. you may notice that I have had some strange scripts there like
  - rbenv global 2.7.1
- gem install bundler
- bundle install

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store