diff --git a/.github/workflows/deploy-to-QA.yml b/.github/workflows/deploy-to-QA.yml index 88d2191b..75aaacb2 100644 --- a/.github/workflows/deploy-to-QA.yml +++ b/.github/workflows/deploy-to-QA.yml @@ -25,10 +25,17 @@ jobs: fixed_version_found=false plugin_version=$(echo "$BRANCH_NAME" | grep -Eo '[0-9].[0-9]+.[0-9]+') jira_fixed_version="React Native SDK v$plugin_version" - # echo "PLUGIN_VERSION=$plugin_version" >> $GITHUB_ENV echo "JIRA_FIXED_VERSION=$jira_fixed_version" >> $GITHUB_ENV chmod +x .github/workflows/scripts/releaseNotesGenerator.sh .github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$jira_fixed_version" + + - name: Check version alignment between platforms + env: + BRANCH_NAME: ${{github.ref_name}} + run: | + plugin_version=$(echo "$BRANCH_NAME" | grep -Eo '[0-9].[0-9]+.[0-9]+') + chmod +x .github/workflows/scripts/versionsAlignmentValidator.sh + .github/workflows/scripts/versionsAlignmentValidator.sh "$plugin_version" - name: Update package.json file run: | diff --git a/.github/workflows/scripts/versionsAlignmentValidator.sh b/.github/workflows/scripts/versionsAlignmentValidator.sh new file mode 100755 index 00000000..eb25fdb4 --- /dev/null +++ b/.github/workflows/scripts/versionsAlignmentValidator.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# Plugin version from release branch +PLUGIN_VERSION=$1 + +# Gets the plugin version for platform_extension_v2 in every platform +IOS_PLUGIN_VERSION=$(cat ios/RNAppsFlyer.h | grep 'kAppsFlyerPluginVersion' | grep -Eo '[0-9].[0-9]+.[0-9]') +ANDROID_PLUGIN_VERSION=$(cat android/src/main/java/com/appsflyer/reactnative/RNAppsFlyerConstants.java | grep 'PLUGIN_VERSION' | grep -Eo '[0-9].[0-9]+.[0-9]') + +# Check if PLUGIN_VERSION, IOS_PLUGIN_VERSION and ANDROID_PLUGIN_VERSION are equal +echo "version from branch: $PLUGIN_VERSION\nplatform_extension_v2 ios: $IOS_PLUGIN_VERSION\nplatform_extension_v2 android: $ANDROID_PLUGIN_VERSION" +if [[ "$PLUGIN_VERSION" == "$IOS_PLUGIN_VERSION" && "$PLUGIN_VERSION" == "$ANDROID_PLUGIN_VERSION" ]]; then + echo "platform_extension_v2 version is aligned" +else + echo "platform_extension_v2 version is different!" + exit 1 +fi \ No newline at end of file