Skip to content

Codemagic

Store APPBARN_TOKEN in a protected Codemagic variable group and run the CLI after the artifact is produced.

yaml
scripts:
  - name: Upload to AppBarn
    script: |
      npm install --global appbarn-cli
      appbarn config set api https://api.app-barn.com
      appbarn config set app "$APPBARN_APP_ID"
      appbarn config set environment "$APPBARN_ENVIRONMENT_ID"
      appbarn upload ./build/app.apk --app-identifier "$APPBARN_APP_IDENTIFIER" --version "$APPBARN_VERSION" --build-number "$APPBARN_BUILD_NUMBER"

AppBarn detects Codemagic provenance from standard environment variables.

Prompt an agent to add Codemagic upload
text
Add an AppBarn upload script to this Codemagic workflow.

Inspect `codemagic.yaml` and the current mobile build output before editing. Place the script after the selected IPA, APK or AAB is generated. Install `appbarn-cli`, configure the API origin plus App and Environment UUIDs, and upload the resolved artifact path. Obtain `APPBARN_TOKEN` only from a protected Codemagic variable group. Use non-secret variables for the App/Environment IDs and required Android application identity, version and build number. Do not print credentials or manually set CI provenance metadata.

Before editing, ask me which workflow and artifact to target if more than one is available. Ask which variable group, App/Environment, artifact-path variable and Android identity source to use whenever the repository or workflow does not establish them. If the token has not been configured, state the required variable name and ask me to add it without sharing its value.

Validate the YAML and report the required protected and non-secret variables plus the script placement.

Common failures

Confirm the variable group is attached to the workflow and the artifact path matches the platform build output. Do not include bearer values in build logs.