This is an example project, with the objective to show how to use CircleCI with Appollo for releasing iOS apps with a CI solution.
To Follow this tutorial you will need :
- An appollo account linked to your Apple Developer Account. Learn how to setup Appollo.
- A Flutter project located at the root of your git repository.
To work properly you need to create this folder at the root of your project
mkdir .circleci/
Inside .circleci you will create a config.yml file. This is where we will add the actions. Here is an example :
version: 2.1
workflows:
testing:
jobs:
- test
- build-ipa:
requires:
- test
filters:
branches:
ignore:
- production
- deploy:
requires:
- test
filters:
branches:
only: production
jobs:
test:
docker:
- image: cirrusci/flutter
steps:
- checkout
- run: flutter test
build-ipa:
docker:
- image: cimg/python:3.11.2
steps:
- checkout
- run: pip3 install --no-input appollo
- run: appollo signin --email '$EMAIL_APPOLO' --password '$PASSWORD_APPOLLO'
- run: appollo build start --build-type=ad-hoc '$APPLICATION_KEY'
- run: appollo signout
deploy:
docker:
- image: cimg/python:3.11.2
steps:
- checkout
- run: pip3 install --no-input appollo
- run: appollo signin --email '$EMAIL_APPOLO' --password '$PASSWORD_APPOLLO'
- run: appollo build start --build-type=publication '$APPLICATION_KEY'
- run: appollo signoutIn this exemple we have 3 variables:
- EMAIL_APPOLO is the email to connect to your account on appollo
- PASSWORD_APPOLLO is the password to connect to your account on appollo
- APPLICATION_KEY is the key off your application.
Here is the documentation for variables on CircleCI
Note
If you forgot the application's Appollo key you can use this following command : appollo app ls
After connected your account (GitHub, GitLab or Bitbucket) you can select your organization and chose the project your want set up.
When you had selected your project you can chose the 'Fastest' solution and specify the branch
To use CircleCI there are 2 possibilities, use the CircleCI's runner (paid solution) or use the self-hosted runners (free solution). In this tutorial we will use the sel-hosted runner.
The first step is agree the CircleCI Runner Terms in organization settings > Self-Hosted Runners. When you add agree the usage terms you can access to Self-Hosted Runners on the left and create ressource class by following the tutorial
Now that you have create your self-hosted runner you can update your workflows with runner informations with this type of structure for each job :
test:
machine: true
resource_class: namespace/resource_class_label
steps:
- checkout
- run: flutter test'Now that all is configured you don't need to do anything else. The previously made worflow is called on each push no matter the branch.
However the last job is call only if there are a push on production branch and the second job isn't call in this case.
When you push your code you can show the workflow executed or in execution in the section Dashboard on the left side of CircleCI
If the unit tests have been successfully passed and the build ipa succeeded you get back the url to the IPA, either to download it, or to install it if opened (in safari) from an iOS device.
Finally if the push was on the production branch the workflow will publish your app on the App Store directly. You can then either test your application through testflight or submit the latest version to Apple.
And that's it with this tutorial you had learn how to use Appollo with Circle .
We propose 3 others examples of solution with other CI tools:



