Skip to main content

Publish your first release

Publish your first release

This is the last step in Setup; it confirms your server, CLI, app, and SDK are wired correctly. After this, see Using Patch for ongoing release workflows.

From your project root, link the project once:

cmpatch init

It finds or asks for the server, signs you in if needed, creates or selects an app per platform with a default deployment, writes codemagic-patch.config.json so later commands can omit --server-url and --app, and then wires the SDK into the app (see Native setup). Every question has a flag for scripted setups, for example cmpatch init --server-url https://updates.example.com --ios-app MyApp-iOS --android-app MyApp-Android --deployment Staging --yes; add --skip-wire to link without touching the app.

Complete any remaining steps reported by init, then rebuild and install the native app with the SDK before testing an OTA release. Follow Native setup for CocoaPods or Expo prebuild steps; an OTA update cannot add the SDK to an existing binary.

Inspect the resolved context:

cmpatch context
cmpatch context --remote # also shows server-provided SDK download base URL

Dry-run, then publish:

# Preview without uploading
cmpatch release-react --platform ios --deployment Staging --dry-run
cmpatch release-react --platform android --deployment Staging --dry-run

# Publish
cmpatch release-react --platform ios --deployment Staging --release-notes "Fix onboarding crash" --yes
cmpatch release-react --platform android --deployment Staging --release-notes "Fix onboarding crash" --yes

release-react analyzes the project, auto-detects the bundler (Metro or Expo), resolves the target binary version, builds the bundle, and uploads it. If auto-detection can't determine a value, pass it explicitly:

cmpatch release-react \
--platform ios \
--deployment Staging \
--target-binary-version 1.2.3 \
--bundler metro \
--entry-file index.js \
--yes

Watch processing complete:

cmpatch release list --app MyApp-iOS --deployment Staging --format table
cmpatch release inspect --app MyApp-iOS --deployment Staging --label v1 --wait
tip

cmpatch bundle --platform ios builds a .cmpatch artifact without uploading, useful for inspecting or publishing later via cmpatch release create --bundle-path file.cmpatch. When the app requires code signing, pass --private-key-path to cmpatch bundle as well.

Next steps​