Uploading Basics

Emerge receives builds created by your CI pipeline, along with additional metadata about where the build was generated. There are two kinds of uploads that are required: base builds and branch builds.

Upload from CI

Configuring automatic uploads from CI requires 2 steps, commonly done in two separate pull requests:

  1. A first PR to configure uploading a base build (usually the default branch, i.e. main or master). This will upload a base build upon merging this first PR, which the second will use as the base to create a diff from!
  2. A second PR to configure uploading branch builds. Uploading branch builds is most commonly done from CI that is run on each pull request. This will create a diff against your base branch upload we set up in step 1.

Base Builds

These are builds of your base branch, which will usually be the default branch, i.e. main or master. For the integration to work, a build needs to be built from every commit pushed to the base branch. These fields are supported:

Field

Required?

filename

Yes

branch

Yes (Should always be the name of your base branch)

sha

Yes

repoName

Yes

buildType

No (defaults to "release" if not provided)

Branch Builds

These are builds originating from an open pull request. Once base builds are being sent to Emerge, you can add branch build uploads to get your first PR comment. These fields are supported:

Field

Required?

filename

Yes

branch

Yes

sha

Yes

baseSha

Yes

repoName

Yes

prNumber

Yes

buildType

No (defaults to "release" if not provided)

🚧

Base SHA

A base SHA must be included with branch builds, this ensures the correct build is used when generating your comparison.

Build type

buildType is an optional parameter that defaults to 'release' if not provided when uploading.

The buildtype is used to separate different types of uploads that might not be intended to be grouped together. Specifying a buildType allows for viewing the dashboard pertaining to just builds matching the selected buildType.

12771277

The dashboard dropdown allows you to show size trends for a specific buildType.

As an example, let's say you want to track size changes for a specific APK you ship for x86 device architectures, then another APK that is the default 'release' build type. You would upload two builds to Emerge, one with the buildType set to the name of that type, say x86, and the other build you don't specify buildtype. This would result in a single Emerge dashboard with a dropdown for release and x86 buildTypes, allowing you to see size trends only for each respective type.

SHA and Base SHA

The sha and baseSha parameters are used to provide Emerge information about the position of your build within your version control system structure.

The sha field should be the commit SHA that your upload was built from. Essentially, it represents the HEAD position for the build, whether the build is on main or a branch.

The baseSha field is used specifically for branch builds. This field represents point in your git tree that your branch was created from. In essence, the baseSha allows Emerge to identify all the changes on a branch. The baseSha should remain the same for all builds on a branch, at least until the branch is rebased.

Supported Artifacts

Emerge supports the following artifacts uploaded for size analysis.

Name

Extension

Platform

Zipped XCArchive

.zip (Zipped .xcarchive)

iOS

Zipped XCFramework

.zip (Zipped .xcframework)

iOS

Android App bundle

.aab

Android

APK

.apk

Android

Zipped APK(s) with proguard mappings

.zip (Zipped .apks(s) with a proguard.txt, mapping.txt proguard.pro, or proguard.map mapping file included).

Note: We require one apk (the primary apk if uploading multiple apks) to be named base.apk.

Android

Zipped AAB with optional test APK

.zip (Zipped .aab with an optional .apk test APK leveraging Emerge's test SDK)

Android

Note: Fastlane will Zip artifacts by default if uploading through the Emerge Fastlane plugin.

Dexguard support

Emerge supports deobfuscating builds obfuscated with Dexguard. Depending on your Dexguard configuration, you might need to provide different mapping files with your Emerge upload. Contact your Emerge team representative for more details specific to your configuration.