Skip to content

Commit

Permalink
platform_extension version validation in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-kremer93 committed Jul 30, 2023
1 parent 60f3b1f commit 0ef77a0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/deploy-to-QA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/scripts/versionsAlignmentValidator.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0ef77a0

Please sign in to comment.