Manual Uploads

If you're not already using Fastlane uploads, the Emerge Gradle Plugin, or the Emerge GitHub Action you can upload manually using the API.

Getting a Signed URL

Using the /upload endpoint you can create a new upload and retrieve a signed URL to upload your uploaded file. The full documentation for this API endpoint is available here.

Emerge supports many common iOS & Android builds, see Supported Artifacts for a comprehensive list of all build types Emerge supports for iOS & Android.

Uploading to the signed URL

With the signed URL, you can make a PUT request to upload your app's build file.

If uploading a .zip file, the request should include the Content-Type: application/zip header. For example:

curl -v -H 'Content-Type: application/zip' \
  -T MyArchive.xcarchive.zip "SIGNED_URL"

A complete example of a manual upload using shell commands is below:

API_KEY=<YOUR_API_KEY_HERE>

json_body='{
    "filename":"example.file",
  "branch":"example_branch_name",
  "repoName":"example_repo_name",
  "buildType":"release",
  "prNumber": "123",
  "sha":"123456",
  "baseSha":"654321"}'

upload_response=$(curl --request POST \
                     --url "https://api.emergetools.com/upload" \
                     --header 'Accept: application/json' \
                     --header 'Content-Type: application/json' \
                     --header "X-API-Token: ${API_KEY}" \
                     --data "${json_body}")

# Pull the uploadURL field from the response using jq
upload_url=$(echo "$upload_response" | jq -r .uploadURL)

curl -v -H 'Content-Type: application/zip' -T <PATH_TO_BUILD_ARTIFACT> "$upload_url"