Circle CI
Circle CI pipeline allows you to build and upload both Android & iOS apps to TestApp.io to notify your testers for testing and feedback.
Configuration
| Key | Description | Env Var(s) | Default |
|---|---|---|---|
| api_token | You can get it from https://portal.testapp.io/profile/tokens | TESTAPPIO_API_TOKEN | |
| app_id | You can get it from your app page at https://portal.testapp.io/apps | TESTAPPIO_APP_ID | |
| release | It can be either both or Android or iOS | TESTAPPIO_RELEASE | |
| apk | Path to the Android APK file | TESTAPPIO_ANDROID_PATH | |
| ipa | Path to the iOS IPA file | TESTAPPIO_IOS_PATH | |
| release_notes | Manually add the release notes to be displayed for the testers | TESTAPPIO_RELEASE_NOTES | |
| git_release_notes | Collect release notes from the latest git commit message to be displayed for the testers: true or false | TESTAPPIO_GIT_RELEASE_NOTES | true |
| git_commit_id | Include the last commit ID in the release notes (works with both release notes options): true or false | TESTAPPIO_GIT_COMMIT_ID | false |
| notify | Send notifications to your team members about this release: true or false | TESTAPPIO_NOTIFY | false |
Check TA-CLI for more info
Setup Circle CI project
Add two project environment variables:
Project Settings → Environment Variables → Add Environment Variable
TESTAPPIO_API_TOKEN=
TESTAPPIO_APP_ID=
These values can be found in App → Integrations → Releases
iOS
Circle CI provides macOS executors for CI/CD pipelines and has Fastlane installed already, which means you don't need to install Fastlane in your pipeline.
Using Fastlane (Build & Upload)
If you haven't yet, set up Fastlane and add the TestApp.io plugin.
fastlane add_plugin testappioIn Circle CI's config.yml, add bundle install, e.g.
# ...
steps:
# ...
- run: bundle install
- run: bundle exec fastlane adhoc --verbose
# ...Make sure that the codesign is configured to "manual" or the gym step of the Circle CI pipeline would fail with the error "no provisioning profile found".
Circle CI will build your project and upload your IPA file to TestApp.io for distribution.
Without Fastlane
version: 2.1
orbs:
ios: circleci/ios@1.0.0
jobs:
build-and-upload-ios:
macos:
xcode: "15.4" # Specify the Xcode version you need
environment:
release_notes: ""
git_release_notes: true
git_commit_id: false
notify: true
steps:
- checkout
# Build and archive the iOS app
- run:
name: Archive iOS app
command: |
xcodebuild -workspace YourWorkspace.xcworkspace -scheme YourScheme -sdk iphoneos -configuration Release archive -archivePath build/YourApp.xcarchive
- run:
name: Export IPA
command: |
xcodebuild -exportArchive -archivePath build/YourApp.xcarchive -exportPath build/ -exportOptionsPlist ExportOptions.plist
# Upload to TestApp.io
- run:
name: Upload to TestApp.io
command: |
export INSTALL_DIR=/tmp
curl -Ls https://github.com/testappio/cli/releases/latest/download/install | bash
$INSTALL_DIR/ta-cli publish --api_token=$TESTAPPIO_API_TOKEN --app_id=$TESTAPPIO_APP_ID --release="ios" --ipa=./build/YourApp.ipa --release_notes=$release_notes --notify=$notify --git_release_notes=$git_release_notes --git_commit_id=$git_commit_id --source="Circle CI"
workflows:
default:
jobs:
- build-and-upload-iosAndroid
Using Fastlane (Build & Upload)
If you haven't yet, set up Fastlane and add the TestApp.io plugin.
fastlane add_plugin testappioIn Circle CI's config.yml:
# ...
steps:
# ...
- run: bundle install
- run: bundle exec fastlane android beta --verbose
# ...Without Fastlane
Create .circleci/config.yml file under your project directory and copy the below snippet.
version: 2.1
orbs:
android: circleci/android@1.0.3
jobs:
build-and-upload:
executor:
name: android/android-machine
environment:
release_notes: ""
git_release_notes: true
git_commit_id: false
notify: true
steps:
- checkout
# For a debug build:
- run:
name: Assemble debug build
command: |
./gradlew assembleDebug
# For a release build:
# - run:
# name: Assemble release build
# command: |
# ./gradlew assembleRelease
- run:
name: Upload to TestApp.io
command: |
export INSTALL_DIR=/tmp
curl -Ls https://github.com/testappio/cli/releases/latest/download/install | bash
$INSTALL_DIR/ta-cli publish --api_token=$TESTAPPIO_API_TOKEN --app_id=$TESTAPPIO_APP_ID --release="android" --apk=./app/build/outputs/apk/debug/app-debug.apk --release_notes=$release_notes --notify=$notify --git_release_notes=$git_release_notes --git_commit_id=$git_commit_id --source="Circle CI"
workflows:
default:
jobs:
- build-and-uploadIf you already have the .circleci/config.yml file, you could copy the build-and-upload job to your pipeline.
Tip: Once your CI/CD pipeline uploads a build, team members using the TestApp.io mobile app receive a push notification and can install the build with a single tap. You can also create share links to distribute builds to external testers and clients.
Need help? Contact us — we're happy to assist!