Skip to content

Cloud Builds ​

QuestionFlag
Build and upload store releases on GitHub Actions?--ci / --no-ci

--ci adds .github/workflows/store-release.yml. Run Store release from the repository's Actions tab, choosing both stores or one. It:

  1. Raises the build number and commits it to the branch.
  2. Builds the iOS app on a macOS runner, signs it with certificates Apple manages in the cloud, and uploads it to TestFlight.
  3. Builds the Android app bundle, signs it with your upload key, and uploads it to Google Play's internal testing track.

Raise the version first with pnpm release:version if the release is a new one.

Secrets ​

Add these under Settings → Secrets and variables → Actions:

SecretValue
ENV_FILEThe contents of .env: the production values the app is built with
APP_STORE_CONNECT_KEYThe .p8 file of an App Store Connect API key with the Admin role (Users and Access → Integrations)
APP_STORE_CONNECT_KEY_IDThat key's ID
APP_STORE_CONNECT_ISSUER_IDThe Issuer ID above the list of keys
ANDROID_KEYSTORE_BASE64Your upload keystore, as base64 -i upload.jks prints it
ANDROID_KEYSTORE_PASSWORDIts password
ANDROID_KEY_ALIASThe key's alias in it
ANDROID_KEY_PASSWORDThe key's password
PLAY_SERVICE_ACCOUNT_JSONThe JSON key of a Google Cloud service account invited in Play Console (Users and permissions) that can release to testing tracks

The Admin role lets xcodebuild create the distribution certificate and profile it signs with, so there is nothing to export from a Mac.

Before the first run ​

  • native.ios.teamId is set, and android/ and ios/ are committed. Creating them (pnpm mobile:init:ios) is the one step that wants a Mac; a colleague's, once, is enough.
  • The app exists in App Store Connect and in Play Console.
  • Google Play takes the first app bundle only by hand: upload one from Play Console before the workflow's first run.
  • If the branch is protected, let github-actions[bot] push to it, so the workflow can commit the build number.

The workflow runs on your GitHub Actions minutes; macOS minutes count more than Linux ones on private repositories. Edit the file freely: it is yours, and nothing regenerates it.

Released under the MIT License.