> For the complete documentation index, see [llms.txt](https://docs.getupdraft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getupdraft.com/~/changes/hCUa1az9yKp7rsxQS8yk/integrations/gitlab-ci/gitlab-api-upload.md).

# GitLab app distribution for iOS builds

GitLab CI/CD can be used to deploy iOS apps with the API Upload (curl) to Updraft.

## Preconditions

### Setting up a Build Runner

A build runner is a physical or virtual machine that has the necessary tools to run your builds. As an iOS Dev, you probably know you need a macOS Machine with Xcode Tools to build your iOS apps. In our Office, we use Mac Minis for this.&#x20;

Once you have a machine that can handle iOS Builds, you can follow the steps in the [GitLab Documentation](https://docs.gitlab.com/runner/install/osx.html#homebrew-installation-alternative) to set up your own runner. Make sure to specify the same `tag` as you used in your `.gitlab-ci.yml` file to restrict the runner to accept only iOS Builds.&#x20;

If you've read until here, you have earned our respect! We hope our guide has been helpful to you. If you have any questions, feel free to contact our support.

## Quick Start&#x20;

* Login into Updraft Toolpage [getupdraft.com/login ](https://getupdraft.com/login)
* Go to your Profile within the Sidebar
* Copy your **API Key** as well as the **App Key** of your App&#x20;
  * Your API Key you find in your Profile. The App Key you will find on the application overview. The App key differs for each environment.
* Go to your Project Settings in Gitlab and select CI/CD

![Gitlab CI/CD Variables Settings](https://1499220200-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LDXK35bj42Hdun3u_Zb%2F-LtKj1Di7qbXfLCZl7ur%2F-LtKzDBeiri4itYZJnO_%2FBildschirmfoto%202019-11-10%20um%2016.43.24.png?alt=media\&token=8a5686ae-8414-4128-b7c2-d53b6e263836)

* Expand your Variables
* **Give a name for your API Key: UPDRAFT\_API\_KEY**
* Paste your Updraft API Key in the Input Value field and click on **Save Variable**
* **Give a name for your App Key: UPDRAFT\_APP\_KEY**
* Paste your Updraft App Key in the Input Value field and click on **Save Variable**

![Updraft API Key and Updraft App Key](https://1499220200-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LDXK35bj42Hdun3u_Zb%2F-LtKj1Di7qbXfLCZl7ur%2F-LtL3ZqLFCpYhiVUUWW8%2FBildschirmfoto%202019-11-10%20um%2017.07.28.png?alt=media\&token=1ee965a5-2280-4979-a70b-7703d5590e41)

## Add a job to your `.gitlab-ci.yml`

To deploy to [Updraft](https://getupdraft.com), add a job to your `.gitlab-ci.yml` configuration.

## Example of .gitlab-cy.yml file for iOS app distribution

```
stages:
  - build_updraft

deploy:
  stage: build_updraft
  only:
  - release
  script:
  - |
    curl \
      -F whats_new="Gitlab build" \
      -F "app=@android.apk" \
      -X PUT https://getupdraft.com/api/app_upload/$UPDRAFT_APP_KEY/$UPDRAFT_API_KEY/

```

### Repository

Example how the root file repository should look like.

![](https://1499220200-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LDXK35bj42Hdun3u_Zb%2F-LvA45huUTCMZiIgfwKq%2F-LvABi2csgIt60sMbNm0%2FBildschirmfoto%202019-12-03%20um%2010.57.14.png?alt=media\&token=0fd58f66-ed02-4a69-9846-c6f001e87436)
