---
updatedAt: 2025-02-13T17:50:33.000Z
agentTools:
  projectIndex: https://docs.emergetools.com/llms.txt
---

# GitHub Action (iOS)

(5 minute setup time)

The [Emerge GitHub Action](https://github.com/marketplace/actions/emerge-upload) allows you to upload app builds from a GitHub workflow. If you are looking to analyze your SPM framework see [Analyzing a SPM Framework (iOS)](https://docs.emergetools.com/docs/analyzing-a-spm-framework-ios).

The open source project can be viewed at <https://github.com/EmergeTools/emerge-upload-action>.

> 📘 Not recommended for Android
>
> Emerge recommends using the [Emerge Gradle plugin](https://docs.emergetools.com/edit/gradle-plugin) as the primary integration point on Android. If using the Gradle Plugin, the GitHub action is not needed, as all upload functionality is built into the plugin.

Disclaimer: If you don't currently have a CI pipeline setup, we'd strongly recommend using Fastlane.

## Usage

The Emerge upload action should be run on any event that should trigger a size analysis. Examples of this are:

* When pushing or merging to specific branches (`main`/`release`).
* On any PR to the main branch.

See [action.yml](https://github.com/EmergeTools/emerge-upload-action/blob/main/action.yml) for all inputs and descriptions.

## Obtain an API key

Follow our steps on [obtaining an API key](https://docs.emergetools.com/docs/uploading-basics#obtain-an-api-key).

Add the API key to your secrets in your repository or organization. **Do not leave this key in plain text in your workflow!**

[Learn more about creating and using encrypted secrets.](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)

## Incorporate in your workflow

Build your artifact in a step before the Emerge upload action. Pass the generated artifact's path as the `artifact_path` argument, and your Emerge API key secret as the `EMERGE_API_KEY` argument:

```yaml
name: Your workflow

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Generate iOS release bundle
        run: # generate release build, e.g. with xcodebuild
      - name: Upload artifact to Emerge
        uses: EmergeTools/emerge-upload-action@v1.1.0
        with:
          artifact_path: path/to/app-release.xcarchive.zip
          emerge_api_key: ${{ secrets.EMERGE_API_KEY }}
          build_type: release # Optional, change if your workflow builds a specific type
```

To enable Pull Request comments, continue to our [GitHub docs](https://docs.emergetools.com/docs/github).

For more details about the upload process and Emerge's supported artifact types, see\
the [Uploading Basics](https://docs.emergetools.com/docs/uploading-basics).