Creating and releasing CodePush updates
Create an update bundle and upload it to the Bitrise CodePush Server to push updates to your users' devices.
Create an update bundle and upload it to the Bitrise CodePush Server to push updates to your users' devices.
Creating an update bundle
React Native
Expo
-
Make the updates to your code.
-
Create an update bundle for both iOS and Android:
-
iOS:
npx react-native bundle \ --platform ios \ --dev false \ --entry-file index.js \ --bundle-output ./build/main.jsbundle \ --assets-dest ./build
-
Android:
npx react-native bundle \ --platform android \ --dev false \ --entry-file index.js \ --bundle-output ./build/index.android.bundle \ --assets-dest ./build
-
-
Zip the build folder:
zip -r update.zip ./build
-
Make the updates to your code.
-
Create an update bundle for both iOS and Android:
-
iOS:
npx expo export:embed \ --entry-file index.js \ --platform ios \ --dev false \ --reset-cache \ --bundle-output ./build/main.jsbundle \ --assets-dest ./build \ --minify false
-
Android:
npx expo export:embed \ --entry-file index.js \ --platform android \ --dev false \ --reset-cache \ --bundle-output ./build/index.android.bundle \ --assets-dest ./build \ --minify false
-
-
Zip the build folder:
zip -r update.zip ./build
Uploading the package to the Bitrise CodePush Server
-
Clone the
release-management-recipesrepository from Bitrise.The repository contains a helper script that we will use to upload the update package.
git clone https://github.com/bitrise-io/release-management-recipes
-
Go in to the
release-management-recipesfolder:cd release-management-recipes
-
Run the script to upload.
The script requires input data:
-
The path of the
update.zipfile. -
Your Bitrise API token: this can be either a personal access token or a workspace API token.
-
The app ID of your Release Management app.
-
A deployment ID: you get this when configuring the CodePush deployment in Release Management.
-
The version of your app.
The final command should look something like this:
PACKAGE_PATH=../update.zip \ AUTHORIZATION_TOKEN=<api-token> \ CONNECTED_APP_ID=<connected-app-id> \ DEPLOYMENT_ID=<deployment-id> \ APP_VERSION=<app-version> /bin/bash ./api/upload_code_push_package.sh
-