Helm Docs

Upload Builds from CI

This tutorial shows how to make your GitHub Actions workflow send each iOS or Android test build to Helm, so testers can install it from a web page. It covers what your app needs, the four API requests in order with every field and response, how the workflow proves who it is, and complete workflows you can copy.

Who this is for: A developer who can edit the app repository's GitHub Actions workflows. The project must have the Build module. To use GitHub's sign-in tokens, an organization Owner or Admin must have connected GitHub. To use an API key instead, a Project Admin or higher must create it.

What you're about to do, in plain English

Your workflow builds the app as usual. Then it makes four web requests:

  1. It tells Helm about the build (the app's name, version and so on). Helm creates a build record and answers with its ID and its install page address.
  2. It asks Helm where to put the file. Helm answers with a private upload address in Helm's storage, valid for one hour.
  3. It uploads the .ipa or .apk file straight to that address. The file does not pass through Helm's web servers, so large files upload quickly and reliably.
  4. It tells Helm the upload has finished. Helm checks the file is there and marks the build Ready.

The build then appears on the OTA Builds page, and anyone with its install page address can install it. Testers can follow Install Builds on Test Devices.

Step 1 — Check what your app needs

iOS

iPhones install apps from outside the App Store only when Apple's signing allows it. Your workflow must produce an .ipa signed in one of two ways:

  • Ad hoc — for most teams. You need a paid Apple Developer Program membership, an Apple Distribution certificate, and an Ad Hoc provisioning profile for the app. A provisioning profile is a file from Apple that lists which devices may run the app.

    Every tester's iPhone or iPad must be registered in your Apple Developer account and included in the profile before the build is made. A device that is not in the profile cannot install the build. To add one: in the Apple Developer website, open Certificates, Identifiers & Profiles → Devices, click +, enter a name and the device's UDID (its unique ID), and click Continue. Then open Profiles, edit the Ad Hoc profile, select the new device, save, download the profile, update it in your workflow's secrets, and build again.

  • Enterprise (in-house) — only for companies in the Apple Developer Enterprise Program, for apps used inside the company. Any device can install the build, but each tester must trust your company's profile once on the device.

Builds signed for the App Store or TestFlight cannot be installed from an install page.

Android

Your workflow must produce an .apk file. An Android App Bundle (.aab) cannot be installed directly, so build an APK. The APK must be signed: a debug build is signed automatically, and a release build needs your own signing key.

Android installs a new build over an older one only when both are signed with the same key. GitHub's runners create a new debug key on every run, so the Android workflow below installs one fixed debug key from a secret first.

Step 2 — Choose how the workflow proves who it is

Every request to Helm's build API carries the header Authorization: Bearer <token>. The token can be one of two things.

GitHub Actions OIDC token (recommended)

An OIDC token is a short-lived signed note from GitHub that names the repository and the run. Helm checks the signature, so no Helm password needs to be stored in GitHub. The workflow asks GitHub for one before each request, for the audience https://app.helmcode.dev, and needs the permission id-token: write. Helm also accepts the audience https://helmcode.dev.

Helm accepts the token when:

  • the repository's GitHub account is connected to your Helm organization — see Connect GitHub for PR Previews;
  • the repository is listed in your project's GitHub Repos setting (Settings → GitHub);
  • the project has the Build module.

Helm picks the project from the repository. If several of your projects list the same repository, add "project": "your-project" to the first request. A build created with an OIDC token can then be uploaded to and updated only with a token from the same repository, or with the project's API key.

Project API key

  1. In Helm, open your project's Settings and click API Keys. This needs the Project Admin role or higher.
  2. Under Generate New Key, type a name in Key Name, for example GitHub Actions builds, and click Generate Key.
  3. Copy the key from the API Key Created window. Helm shows it only once.
  4. In GitHub, open the repository's Settings, then Secrets and variables → Actions, click New repository secret, name it HELM_API_TOKEN, paste the key, and click Add secret.

An API key acts with the role of the person who created it, so that person must keep access to the Build module on the project.

Warning: An API key can create and change any build in the project, and the PR previews too. Store it only as a GitHub secret, never in a workflow file. If it leaks, click Revoke next to it on the API Keys tab and generate a new one.

Step 3 — The API requests

All four requests go to https://app.helmcode.dev/api/. The examples show the request body and Helm's answer. In every request, replace <id> with the build's id.

Note: The install links Helm returns stay on https://helmcode.dev/builds/. New set-ups use https://app.helmcode.dev. Workflows, apps and connectors that already use https://helmcode.dev keep working; you do not need to change them.

1. Register the build: POST /api/builds/

The body is JSON with these fields:

FieldRequiredWhat to send
app_nameYesThe name testers see, up to 200 characters.
platformYesios or android. (django records a backend build with no file.)
bundle_identifierYesThe app's bundle ID (iOS) or package name (Android), for example com.example.myapp. For iOS it must match the .ipa exactly, or the install fails.
versionYesThe version testers see, for example 1.4.0, up to 50 characters.
build_numberYesThe build number, for example 212, up to 50 characters.
environmentNoWhich backend the build uses: development, qa, staging or production. Shown as a coloured label.
branchNoThe Git branch, up to 200 characters.
pr_numberNoThe pull request number, a whole number above 0.
commit_shaNoThe commit the build was made from, up to 40 characters.
github_run_idNoThe GitHub Actions run ID, shown in the Run # column.
github_run_urlNoThe run's address, for example https://github.com/your-org/your-app/actions/runs/123456789. Helm links to it and uses it to mark the build Canceled or Failed if the run stops early. It must be a GitHub Actions run address in exactly this form; any other address is refused with an error.
release_notesNoText shown under Release Notes on the install page, for example what to test.
display_image_urlNoiOS only. The https:// address of a 57 × 57 pixel PNG icon that iOS shows while the app installs.
full_size_image_urlNoiOS only. The https:// address of a 512 × 512 pixel PNG icon for the same purpose.
projectNoYour Helm project's short name. Needed only with an OIDC token, when several projects list the repository.

Example body:

{
  "app_name": "My App",
  "platform": "ios",
  "bundle_identifier": "com.example.myapp",
  "version": "1.4.0",
  "build_number": "212",
  "environment": "qa",
  "branch": "feature/checkout",
  "pr_number": 42,
  "commit_sha": "9f1c2ab7e4d3c5b6a7f8e9d0c1b2a3f4e5d6c7b8",
  "github_run_id": "123456789",
  "github_run_url": "https://github.com/your-org/your-app/actions/runs/123456789",
  "release_notes": "Try the new checkout screen."
}

Helm answers 201 Created:

{
  "id": "3f2a9c4e-1b7d-4e8a-9f60-2d5c8b1a7e43",
  "status": "building",
  "install_url": "https://helmcode.dev/builds/3f2a9c4e-1b7d-4e8a-9f60-2d5c8b1a7e43/"
}

The build now shows as Building. You can register it before compiling the app, so the OTA Builds page shows it while it builds, or afterwards, as the workflows below do.

2. Ask for an upload address: POST /api/builds/<id>/upload-url/

The body names the file. Helm uses its extension, .ipa or .apk.

{"file_name": "MyApp.ipa"}

Helm answers 200 OK:

{
  "id": "3f2a9c4e-1b7d-4e8a-9f60-2d5c8b1a7e43",
  "upload_url": "https://...",
  "http_method": "PUT",
  "required_headers": {"Content-Type": "application/octet-stream"},
  "upload_token": "eyJidWlsZF9pZCI6...",
  "expires_at": "2026-11-03T15:04:05.123456+00:00",
  "complete_url": "https://app.helmcode.dev/api/builds/3f2a9c4e-1b7d-4e8a-9f60-2d5c8b1a7e43/upload-complete/"
}
  • upload_url is a private address in Helm's storage. The upload must start before expires_at, one hour later. An upload that starts in time may take longer.
  • required_headers lists the headers the upload must send, exactly. The Content-Type is application/octet-stream for an .ipa and application/vnd.android.package-archive for an .apk.
  • upload_token is what you send in request 4. It stays valid for 24 hours.

3. Upload the file: PUT to upload_url

Send the whole file in one PUT request, with the Content-Type from required_headers and no Authorization header. Storage answers 200 when the file is saved.

curl --fail-with-body -sS --upload-file MyApp.ipa \
  -H "Content-Type: application/octet-stream" \
  "$UPLOAD_URL"

4. Finish the upload: POST /api/builds/<id>/upload-complete/

{"upload_token": "eyJidWlsZF9pZCI6..."}

Helm checks the file is in storage, records its size and answers 200 OK:

{
  "id": "3f2a9c4e-1b7d-4e8a-9f60-2d5c8b1a7e43",
  "status": "ready",
  "file_name": "MyApp.ipa",
  "file_size": 48213504,
  "install_url": "https://helmcode.dev/builds/3f2a9c4e-1b7d-4e8a-9f60-2d5c8b1a7e43/"
}

If your organization's build storage is full, Helm first deletes the files of its oldest unpinned builds to make room. See "How long builds and links last" in The OTA Builds Page. Uploading again to the same build replaces its file.

Report a failure: POST /api/builds/<id>/status/

If the workflow fails after registering a build, tell Helm so testers do not wait for it. The status is one of building, ready, failed, expired or canceled; in practice you send failed or canceled. The optional error_message appears on the install page.

{"status": "failed", "error_message": "Archive step failed. See the GitHub Actions run."}

Helm answers 200 OK:

{"id": "3f2a9c4e-1b7d-4e8a-9f60-2d5c8b1a7e43", "status": "failed"}

Step 4 — Add the upload script

Both workflows below call the same script, which makes the four requests and stops with a clear message if any of them fails. Save it in your app repository as .github/scripts/helm-ota-upload.sh and make it executable with chmod +x .github/scripts/helm-ota-upload.sh.

The script uses the project API key when the HELM_API_TOKEN environment variable is set, and a GitHub OIDC token otherwise. It reads the app's details from the environment variables APP_NAME, BUNDLE_ID, VERSION and BUILD_NUMBER, which the workflows set, and, if they are set, HELM_ENVIRONMENT, PR_NUMBER, COMMIT_SHA, RELEASE_NOTES and HELM_PROJECT.

#!/usr/bin/env bash
# Sends one build to Helm: registers it, uploads the file straight to Helm's
# storage, and marks it Ready.
# Usage: helm-ota-upload.sh <path to .ipa or .apk> <ios|android>
set -euo pipefail

FILE="$1"
PLATFORM="$2"
HELM_API_URL="${HELM_API_URL:-https://app.helmcode.dev/api}"
HELM_AUDIENCE="${HELM_AUDIENCE:-https://app.helmcode.dev}"
BUILD_ID=""

# Prints a token for one request. A GitHub OIDC token lasts only a few
# minutes, so the script asks for a fresh one every time.
helm_token() {
  if [ -n "${HELM_API_TOKEN:-}" ]; then
    echo "$HELM_API_TOKEN"
    return
  fi
  curl -sSf -H "Authorization: Bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" \
    "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=${HELM_AUDIENCE}" \
    | python3 -c "import sys,json; print(json.load(sys.stdin)['value'])"
}

# helm_post URL JSON_BODY: prints Helm's answer, or stops on any status but 2xx.
helm_post() {
  local response code body
  response=$(curl -sS -w "\n%{http_code}" -X POST "$1" \
    -H "Authorization: Bearer $(helm_token)" \
    -H "Content-Type: application/json" -d "$2")
  code=$(echo "$response" | tail -1)
  body=$(echo "$response" | sed '$d')
  if [ "${code:0:1}" != "2" ]; then
    echo "::error::Helm answered HTTP ${code} for $1: ${body}" >&2
    return 1
  fi
  echo "$body"
}

# json_field PATH: reads one value from the JSON on standard input.
json_field() {
  python3 -c "import sys,json; print(json.load(sys.stdin)$1)"
}

# If anything fails after the build is registered, mark it Failed in Helm.
report_failure() {
  if [ -n "$BUILD_ID" ]; then
    helm_post "${HELM_API_URL}/builds/${BUILD_ID}/status/" \
      '{"status": "failed", "error_message": "The upload from CI failed. See the GitHub Actions run."}' \
      > /dev/null || true
  fi
}
trap report_failure ERR

# 1. Register the build.
BODY=$(python3 -c '
import json, os, sys
e = os.environ
pr = e.get("PR_NUMBER", "")
run_url = ""
if e.get("GITHUB_RUN_ID"):
    run_url = e["GITHUB_SERVER_URL"] + "/" + e["GITHUB_REPOSITORY"] + "/actions/runs/" + e["GITHUB_RUN_ID"]
body = dict(
    app_name=e["APP_NAME"],
    platform=sys.argv[1],
    bundle_identifier=e["BUNDLE_ID"],
    version=e["VERSION"],
    build_number=e["BUILD_NUMBER"],
    environment=e.get("HELM_ENVIRONMENT", ""),
    branch=e.get("GITHUB_HEAD_REF") or e.get("GITHUB_REF_NAME", ""),
    commit_sha=e.get("COMMIT_SHA") or e.get("GITHUB_SHA", ""),
    pr_number=int(pr) if pr else None,
    github_run_id=e.get("GITHUB_RUN_ID", ""),
    github_run_url=run_url,
    release_notes=e.get("RELEASE_NOTES", ""),
)
if e.get("HELM_PROJECT"):
    body["project"] = e["HELM_PROJECT"]
print(json.dumps(body))
' "$PLATFORM")
CREATED=$(helm_post "${HELM_API_URL}/builds/" "$BODY")
BUILD_ID=$(echo "$CREATED" | json_field "['id']")
INSTALL_URL=$(echo "$CREATED" | json_field "['install_url']")
echo "Registered build ${BUILD_ID}"

# 2. Ask for an upload address.
NAME_BODY=$(python3 -c 'import json,sys; print(json.dumps(dict(file_name=sys.argv[1])))' "$(basename "$FILE")")
UPLOAD=$(helm_post "${HELM_API_URL}/builds/${BUILD_ID}/upload-url/" "$NAME_BODY")
UPLOAD_URL=$(echo "$UPLOAD" | json_field "['upload_url']")
CONTENT_TYPE=$(echo "$UPLOAD" | json_field "['required_headers']['Content-Type']")
UPLOAD_TOKEN=$(echo "$UPLOAD" | json_field "['upload_token']")
COMPLETE_URL=$(echo "$UPLOAD" | json_field "['complete_url']")

# 3. Upload the file to Helm's storage, with exactly the header Helm named.
curl --fail-with-body -sS --upload-file "$FILE" \
  -H "Content-Type: ${CONTENT_TYPE}" "$UPLOAD_URL"

# 4. Tell Helm the upload has finished. The build becomes Ready.
TOKEN_BODY=$(python3 -c 'import json,sys; print(json.dumps(dict(upload_token=sys.argv[1])))' "$UPLOAD_TOKEN")
helm_post "$COMPLETE_URL" "$TOKEN_BODY" > /dev/null

echo "Install page: ${INSTALL_URL}"
if [ -n "${GITHUB_OUTPUT:-}" ]; then
  echo "build_id=${BUILD_ID}" >> "$GITHUB_OUTPUT"
  echo "install_url=${INSTALL_URL}" >> "$GITHUB_OUTPUT"
fi
if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then
  echo "Install ${APP_NAME} ${VERSION} (${BUILD_NUMBER}): ${INSTALL_URL}" >> "$GITHUB_STEP_SUMMARY"
fi

The values reach the script through environment variables rather than being written into it, so nothing in a branch name or release note can run as a shell command.

Step 5 — Add the iOS workflow

This workflow builds an ad hoc .ipa on a GitHub macOS runner and sends it to Helm, for every pull request and every push to main. It follows GitHub's own method for installing an Apple signing certificate on a runner.

Add the signing secrets

On your Mac, export the Apple Distribution certificate from Keychain Access as a .p12 file with a password, and download the Ad Hoc provisioning profile from the Apple Developer website. Turn each file into text with these commands:

base64 -i Certificates.p12 | pbcopy
base64 -i MyApp_AdHoc.mobileprovision | pbcopy

Each command copies the text to the clipboard. In GitHub, open the repository's Settings → Secrets and variables → Actions and add four repository secrets:

  • BUILD_CERTIFICATE_BASE64 — the text from the first command.
  • P12_PASSWORD — the password you gave the .p12 file.
  • BUILD_PROVISION_PROFILE_BASE64 — the text from the second command.
  • KEYCHAIN_PASSWORD — any new random password. The workflow uses it for a temporary keychain.

Add the export options file

Save this file in your repository as ExportOptions.plist. Replace ABCDE12345 with your Apple team ID, com.example.myapp with your bundle ID, and MyApp Ad Hoc with the profile's name. For an enterprise build, change release-testing to enterprise. With Xcode older than 15.3, use ad-hoc instead of release-testing.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>method</key>
    <string>release-testing</string>
    <key>signingStyle</key>
    <string>manual</string>
    <key>teamID</key>
    <string>ABCDE12345</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>com.example.myapp</key>
        <string>MyApp Ad Hoc</string>
    </dict>
</dict>
</plist>

Add the workflow

Note: The workflows on this page run on GitHub's own runners (macos-15 and ubuntu-latest). To run them on Helm's build machines instead, change runs-on as described in Run Builds on Helm. Example Workflows has complete versions that run on Helm with fastlane and the build cache.

Save this as .github/workflows/ios-ota.yml. Change WORKSPACE and SCHEME to your app's. If your app has an .xcodeproj but no workspace, replace -workspace "$WORKSPACE" with -project MyApp.xcodeproj. The project's Release configuration must use manual signing with the same certificate and profile.

name: iOS OTA build
on:
  pull_request:
  push:
    branches: [main]
  workflow_dispatch:

permissions:
  id-token: write   # lets the job ask GitHub for an OIDC token for Helm
  contents: read

env:
  WORKSPACE: MyApp.xcworkspace
  SCHEME: MyApp
  HELM_ENVIRONMENT: qa

jobs:
  build:
    runs-on: macos-15
    steps:
      - uses: actions/checkout@v4

      - name: Install the signing certificate and provisioning profile
        env:
          BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
          P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
          BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
          KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
        run: |
          CERT_PATH="$RUNNER_TEMP/build_certificate.p12"
          PP_PATH="$RUNNER_TEMP/build_pp.mobileprovision"
          KEYCHAIN_PATH="$RUNNER_TEMP/app-signing.keychain-db"
          echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o "$CERT_PATH"
          echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o "$PP_PATH"
          security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
          security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
          security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
          security import "$CERT_PATH" -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH"
          security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
          security list-keychain -d user -s "$KEYCHAIN_PATH"
          mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
          mkdir -p "$HOME/Library/Developer/Xcode/UserData/Provisioning Profiles"
          cp "$PP_PATH" "$HOME/Library/MobileDevice/Provisioning Profiles/"
          cp "$PP_PATH" "$HOME/Library/Developer/Xcode/UserData/Provisioning Profiles/"

      - name: Build and export the .ipa
        run: |
          xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -configuration Release \
            -destination 'generic/platform=iOS' \
            -archivePath "$RUNNER_TEMP/App.xcarchive" archive
          xcodebuild -exportArchive -archivePath "$RUNNER_TEMP/App.xcarchive" \
            -exportOptionsPlist ExportOptions.plist -exportPath "$RUNNER_TEMP/export"
          IPA_PATH=$(ls "$RUNNER_TEMP"/export/*.ipa | head -1)
          echo "IPA_PATH=$IPA_PATH" >> "$GITHUB_ENV"

      - name: Read the app details from the .ipa
        run: |
          mkdir -p "$RUNNER_TEMP/ipa"
          unzip -q -o "$IPA_PATH" 'Payload/*.app/Info.plist' -d "$RUNNER_TEMP/ipa"
          PLIST=$(ls "$RUNNER_TEMP"/ipa/Payload/*.app/Info.plist | head -1)
          read_key() { /usr/libexec/PlistBuddy -c "Print :$1" "$PLIST" 2>/dev/null || true; }
          APP_NAME=$(read_key CFBundleDisplayName)
          [ -n "$APP_NAME" ] || APP_NAME=$(read_key CFBundleName)
          echo "APP_NAME=$APP_NAME" >> "$GITHUB_ENV"
          echo "BUNDLE_ID=$(read_key CFBundleIdentifier)" >> "$GITHUB_ENV"
          echo "VERSION=$(read_key CFBundleShortVersionString)" >> "$GITHUB_ENV"
          echo "BUILD_NUMBER=$(read_key CFBundleVersion)" >> "$GITHUB_ENV"

      - name: Send the build to Helm
        id: helm
        env:
          PR_NUMBER: ${{ github.event.pull_request.number }}
          COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
          RELEASE_NOTES: ${{ github.event.pull_request.title }}
        run: .github/scripts/helm-ota-upload.sh "$IPA_PATH" ios

      - name: Remove the temporary keychain
        if: always()
        run: security delete-keychain "$RUNNER_TEMP/app-signing.keychain-db" || true

The app details are read from the finished .ipa, so the bundle ID Helm gives the iPhone always matches the app. A mismatch is a common cause of failed installs.

Step 6 — Add the Android workflow

This workflow builds a debug .apk on a GitHub Linux runner and sends it to Helm.

Add the signing key secret

So that each new build installs over the last one, every build must be signed with the same key. Use the debug key on your own computer, which Android Studio created at ~/.android/debug.keystore. Turn it into text with this command:

base64 -i ~/.android/debug.keystore | pbcopy

On Linux, use base64 -w0 ~/.android/debug.keystore and copy the output. In GitHub, add it as a repository secret named ANDROID_DEBUG_KEYSTORE_BASE64. If you do not add this secret, remove the Install the shared debug signing key step from the workflow; testers will then have to uninstall the app before installing each new build.

Add the workflow

Save this as .github/workflows/android-ota.yml. If your app module is not called app, change app/build/outputs/apk/debug to match.

name: Android OTA build
on:
  pull_request:
  push:
    branches: [main]
  workflow_dispatch:

permissions:
  id-token: write   # lets the job ask GitHub for an OIDC token for Helm
  contents: read

env:
  HELM_ENVIRONMENT: qa

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: '17'

      - name: Install the shared debug signing key
        env:
          ANDROID_DEBUG_KEYSTORE_BASE64: ${{ secrets.ANDROID_DEBUG_KEYSTORE_BASE64 }}
        run: |
          mkdir -p "$HOME/.android"
          echo -n "$ANDROID_DEBUG_KEYSTORE_BASE64" | base64 --decode > "$HOME/.android/debug.keystore"

      - name: Build the APK
        run: ./gradlew assembleDebug

      - name: Read the app details from the APK
        run: |
          APK_PATH=$(ls app/build/outputs/apk/debug/*.apk | head -1)
          AAPT="$(ls -d "$ANDROID_HOME"/build-tools/* | sort -V | tail -1)/aapt"
          BADGING=$("$AAPT" dump badging "$APK_PATH")
          echo "APK_PATH=$APK_PATH" >> "$GITHUB_ENV"
          echo "BUNDLE_ID=$(echo "$BADGING" | sed -n "s/^package: name='\([^']*\)'.*/\1/p")" >> "$GITHUB_ENV"
          echo "BUILD_NUMBER=$(echo "$BADGING" | sed -n "s/.*versionCode='\([^']*\)'.*/\1/p")" >> "$GITHUB_ENV"
          echo "VERSION=$(echo "$BADGING" | sed -n "s/.*versionName='\([^']*\)'.*/\1/p")" >> "$GITHUB_ENV"
          echo "APP_NAME=$(echo "$BADGING" | sed -n "s/^application-label:'\(.*\)'$/\1/p")" >> "$GITHUB_ENV"

      - name: Send the build to Helm
        id: helm
        env:
          PR_NUMBER: ${{ github.event.pull_request.number }}
          COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
          RELEASE_NOTES: ${{ github.event.pull_request.title }}
        run: .github/scripts/helm-ota-upload.sh "$APK_PATH" android

To send a release build instead, set up a signingConfig for the release build type in your Gradle file with your own key, run ./gradlew assembleRelease, and change the path to app/build/outputs/apk/release. An unsigned release APK cannot be installed.

Using the project API key instead of OIDC

In either workflow, add the secret to the Send the build to Helm step's env:. The script then uses the key, and the workflow no longer needs id-token: write.

          HELM_API_TOKEN: ${{ secrets.HELM_API_TOKEN }}

Linking a build to a pull request or branch

The script sends the branch (branch), the pull request number (pr_number), the commit (commit_sha) and the run (github_run_id and github_run_url). Helm shows them in the Branch, PR and Run # columns of the OTA Builds page and on the install page, so testers can tell which change they are trying.

To post the install link on the pull request, add a step after Send the build to Helm. It needs pull-requests: write added under the workflow's permissions:.

      - name: Post the install link on the pull request
        if: github.event_name == 'pull_request'
        env:
          GH_TOKEN: ${{ github.token }}
          PR_NUMBER: ${{ github.event.pull_request.number }}
          INSTALL_URL: ${{ steps.helm.outputs.install_url }}
        run: gh pr comment "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --body "Install this build: $INSTALL_URL"

Pointing a build at a PR preview backend

A PR preview is a short-lived copy of your backend that Helm builds for a branch or pull request. Helm does not store a preview address on a build, so the app must have the address built into it. The workflow does this in three parts:

  1. Before building the app, ask Helm for a preview and wait until it is ready, as in the preview job of Set Up PR Previews. That job gives the address as the output preview_url. Add needs: preview to your build job, and give the build step the address as an environment variable:

            env:
              PREVIEW_URL: ${{ needs.preview.outputs.preview_url }}
  2. Pass the address into the app build. For iOS, add a key to your Info.plist whose value is $(API_BASE_URL), read it in the app, and add the build setting to the archive command:

    xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -configuration Release \
      -destination 'generic/platform=iOS' \
      -archivePath "$RUNNER_TEMP/App.xcarchive" archive \
      API_BASE_URL="$PREVIEW_URL"

    For Android, read a Gradle property into BuildConfig in app/build.gradle.kts (this needs buildFeatures { buildConfig = true }):

    buildConfigField(
        "String",
        "API_BASE_URL",
        "\"" + (project.findProperty("apiBaseUrl") ?: "https://api.example.com") + "\""
    )

    and pass it when building:

    ./gradlew assembleDebug -PapiBaseUrl="$PREVIEW_URL"
  3. Tell testers which backend the build uses. Set RELEASE_NOTES on the Send the build to Helm step so the address appears on the install page:

              RELEASE_NOTES: "Uses the preview backend ${{ needs.preview.outputs.preview_url }}"

Remember that a preview is torn down when its pull request closes or its time runs out. A build pointed at it then stops reaching a backend. See Preview Lifecycle.

Troubleshooting

Helm's answers are JSON. Most errors have the form {"error": {"message": "...", "code": "..."}}; the checks on the request body answer {"error": "..."} with a message only. The script prints the answer in the step's log.

401 auth_required: "Missing or invalid Authorization header"

The request had no Authorization: Bearer header. With OIDC, check that the workflow has permissions: id-token: write; without it, GitHub does not give the job a token. With an API key, check the secret is named HELM_API_TOKEN and is passed in the step's env:.

401 invalid_oidc_token

The OIDC token was refused. The message says why: "The token has expired.", "The token audience must be one of: https://helmcode.dev, https://app.helmcode.dev.", or another reason. Ask for a fresh token for each request, with audience=https://app.helmcode.dev. The script above does both.

403 invalid_api_key: "Invalid API key"

The key is wrong or was revoked. Generate a new key on the project's API Keys tab and update the HELM_API_TOKEN secret.

403 no_matching_project

The message starts "No Helm project can take requests from" and names your repository. Either its GitHub account is not connected to your Helm organization, or no project lists the repository. Connect GitHub in Company settings → GitHub (see Connect GitHub for PR Previews), and add the repository to the project's GitHub Repos setting.

409 project_required

The message starts "Several Helm projects list" your repository and names them. Set HELM_PROJECT in the step's env: to one of the names, for example HELM_PROJECT: your-project.

403 module_not_entitled: "Project is not entitled to this module."

The project does not have the Build module. Contact Helm support to add it.

403 module_not_in_authorization: "API key's user is not authorized for this module on this project."

The person who created the API key no longer has Build access on the project. Give them access again, or have someone with Build access generate a new key.

403 forbidden: "This OIDC token may not act on this build." or "Build does not belong to this project"

The build was created by a different repository or a different project. Upload to a build your workflow created itself, in the same run.

403 github_owner_id_mismatch

The GitHub account in the token has a different numeric ID from the one Helm recorded, which happens when an account is renamed and its old name is taken by someone else. Contact Helm support.

503 oidc_keys_unavailable: "Helm could not fetch GitHub's OIDC signing keys. Try again."

Helm could not reach GitHub to check the token. Run the job again.

400 "Missing required fields: ..."

One of app_name, platform, bundle_identifier, version or build_number was missing or empty. The message lists which. In the workflows above, the step that reads the app details found nothing: check the path to the .ipa or .apk.

400 "Invalid platform. Must be one of: ios, android, django"

Send platform in lower case: ios or android.

400 "Invalid environment. Must be one of: development, qa, staging, production"

Set HELM_ENVIRONMENT to one of those four values, in lower case, or leave it out.

400 "pr_number must be a positive integer"

Send the pull request number as a whole number above 0, or leave it out on runs that are not for a pull request.

The upload PUT fails with 403 and SignatureDoesNotMatch

The upload sent a different Content-Type from the one in required_headers, or added other headers. Send exactly the header Helm named. If the error says the request has expired, more than an hour passed between asking for the address and starting the upload; ask for a new one.

400 artifact_not_found

"Uploaded artifact not found in storage." The completion request came before the file was uploaded, or the upload failed. Check that the PUT answered 200 before calling upload-complete.

400 invalid_token

"Upload token has expired. Request a new upload URL." means more than 24 hours passed; "Invalid upload token." or "Upload token was issued for a different build." means the upload_token was changed or belongs to another build. Ask for a new upload address for this build and upload again.

400 presigned_upload_unsupported

The Helm server you are using cannot give upload addresses. Upload the file through Helm instead, as a form field named artifact, which marks the build Ready in one step:

curl --fail-with-body -sS -X POST -H "Authorization: Bearer $HELM_API_TOKEN" \
  -F "[email protected]" "https://app.helmcode.dev/api/builds/$BUILD_ID/upload/"

The build installs on some iPhones but not others

The devices that fail are not in the ad hoc provisioning profile. Register them, update the profile, update the BUILD_PROVISION_PROFILE_BASE64 secret, and build again. See Step 1 and Install Builds on Test Devices.