GitHub Action

(5 minute setup time)

The Emerge GitHub Action allows you to upload builds from a GitHub workflow.

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

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 for all inputs and descriptions.

Obtain an API key

Follow our steps on obtaining 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.

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:

name: Your workflow

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

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[email protected]
      - name: Generate Android (or iOS) release bundle
        run: # generate release artifacts, e.g. with Gradle or xcodebuild
      - name: Upload artifact to Emerge
        uses: EmergeTools/[email protected]
        with:
          artifact_path: path/to/app-release.aab (or a .xcarchive.zip for iOS)
          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.

For more details about the upload process and Emerge's supported artifact types, see
the Uploading Basics.