Skip to content

Commit 0ef77a0

Browse files
committed
platform_extension version validation in workflow
1 parent 60f3b1f commit 0ef77a0

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.github/workflows/deploy-to-QA.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,17 @@ jobs:
2525
fixed_version_found=false
2626
plugin_version=$(echo "$BRANCH_NAME" | grep -Eo '[0-9].[0-9]+.[0-9]+')
2727
jira_fixed_version="React Native SDK v$plugin_version"
28-
# echo "PLUGIN_VERSION=$plugin_version" >> $GITHUB_ENV
2928
echo "JIRA_FIXED_VERSION=$jira_fixed_version" >> $GITHUB_ENV
3029
chmod +x .github/workflows/scripts/releaseNotesGenerator.sh
3130
.github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$jira_fixed_version"
31+
32+
- name: Check version alignment between platforms
33+
env:
34+
BRANCH_NAME: ${{github.ref_name}}
35+
run: |
36+
plugin_version=$(echo "$BRANCH_NAME" | grep -Eo '[0-9].[0-9]+.[0-9]+')
37+
chmod +x .github/workflows/scripts/versionsAlignmentValidator.sh
38+
.github/workflows/scripts/versionsAlignmentValidator.sh "$plugin_version"
3239
3340
- name: Update package.json file
3441
run: |
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
# Plugin version from release branch
4+
PLUGIN_VERSION=$1
5+
6+
# Gets the plugin version for platform_extension_v2 in every platform
7+
IOS_PLUGIN_VERSION=$(cat ios/RNAppsFlyer.h | grep 'kAppsFlyerPluginVersion' | grep -Eo '[0-9].[0-9]+.[0-9]')
8+
ANDROID_PLUGIN_VERSION=$(cat android/src/main/java/com/appsflyer/reactnative/RNAppsFlyerConstants.java | grep 'PLUGIN_VERSION' | grep -Eo '[0-9].[0-9]+.[0-9]')
9+
10+
# Check if PLUGIN_VERSION, IOS_PLUGIN_VERSION and ANDROID_PLUGIN_VERSION are equal
11+
echo "version from branch: $PLUGIN_VERSION\nplatform_extension_v2 ios: $IOS_PLUGIN_VERSION\nplatform_extension_v2 android: $ANDROID_PLUGIN_VERSION"
12+
if [[ "$PLUGIN_VERSION" == "$IOS_PLUGIN_VERSION" && "$PLUGIN_VERSION" == "$ANDROID_PLUGIN_VERSION" ]]; then
13+
echo "platform_extension_v2 version is aligned"
14+
else
15+
echo "platform_extension_v2 version is different!"
16+
exit 1
17+
fi

0 commit comments

Comments
 (0)