From a414ab2426a4ab27af73ec9fe5d416037ad58cf7 Mon Sep 17 00:00:00 2001 From: Muhammad Rehan Date: Thu, 26 Sep 2024 15:11:02 +0500 Subject: [PATCH] chore: android user agent client source (#330) --- .github/workflows/deploy-sdk.yml | 5 +++++ android/gradle.properties | 3 ++- android/src/main/AndroidManifest.xml | 13 +++++++++++++ .../src/main/res/values/customer_io_config.xml | 13 +++++++++++++ scripts/update-version.sh | 17 ++++++++++++----- 5 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 android/src/main/res/values/customer_io_config.xml diff --git a/.github/workflows/deploy-sdk.yml b/.github/workflows/deploy-sdk.yml index eac5c662..6916c975 100644 --- a/.github/workflows/deploy-sdk.yml +++ b/.github/workflows/deploy-sdk.yml @@ -22,6 +22,11 @@ jobs: steps: - uses: actions/checkout@v4 + # If using sd on macos, "brew install" works great. for Linux, this is the recommended way. + - name: Install sd CLI to use later in the workflow + # uses: kenji-miyake/setup-sd@v1 + uses: levibostian/setup-sd@add-file-extension # Using fork until upstream Action has bug fixed in it. + - name: Deploy git tag via semantic release uses: cycjimmy/semantic-release-action@v4 id: semantic-release diff --git a/android/gradle.properties b/android/gradle.properties index 8ac1a2b0..7c052c8e 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -2,4 +2,5 @@ customerio.reactnative.kotlinVersion=1.7.21 customerio.reactnative.compileSdkVersion=33 customerio.reactnative.targetSdkVersion=33 customerio.reactnative.minSdkVersion=21 -customerio.reactnative.cioSDKVersionAndroid=4.1.0 +# TODO: Update snapshot version to stable version before final release +customerio.reactnative.cioSDKVersionAndroid=feature-react-native-cdp-SNAPSHOT diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 86d2dd6d..5deacb42 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -3,4 +3,17 @@ + + + + + + diff --git a/android/src/main/res/values/customer_io_config.xml b/android/src/main/res/values/customer_io_config.xml new file mode 100644 index 00000000..8604f074 --- /dev/null +++ b/android/src/main/res/values/customer_io_config.xml @@ -0,0 +1,13 @@ + + + + ReactNative + + 3.8.0 + diff --git a/scripts/update-version.sh b/scripts/update-version.sh index a6c6ded8..de5558e0 100755 --- a/scripts/update-version.sh +++ b/scripts/update-version.sh @@ -10,10 +10,17 @@ set -e NEW_VERSION="$1" -echo "Updating package.json to new version: $NEW_VERSION" - +# Update new version in package.json file +PACKAGE_JSON_SOURCE_FILE="package.json" +echo "Updating package.json at: $PACKAGE_JSON_SOURCE_FILE to new version: $NEW_VERSION" npm version "$NEW_VERSION" --no-git-tag-version --allow-same-version +echo "Done! Showing changes to confirm:" +git diff $PACKAGE_JSON_SOURCE_FILE -echo "Check package.json file. You should see version inside has been updated!" - -cat package.json \ No newline at end of file +# Update new version in customer_io_config.xml file +SDK_CONFIG_XML_FILE="android/src/main/res/values/customer_io_config.xml" +SDK_CONFIG_CLIENT_VERSION_KEY="customer_io_react_native_sdk_client_version" +echo "Updating customer_io_config.xml at: $SDK_CONFIG_XML_FILE to new version: $NEW_VERSION" +sd ".*" "$NEW_VERSION" $SDK_CONFIG_XML_FILE +echo "Done! Showing changes to confirm:" +git diff $SDK_CONFIG_XML_FILE