Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 34 additions & 12 deletions appium/scripts/checkout-releases.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
# Check out the latest stable release point in each downstream SDK repo.
# Check out the latest stable release point for the requested downstream SDKs.
# - rel-branch repos: newest stable rel/X.Y.Z branch (betas + non-semver excluded)
# - tag-only repos (expo, ios): newest semver tag (detached HEAD)
# Pass SDK names as arguments; omitting them checks out every SDK.
# Repo paths honor the same *_DIR overrides as run-local.sh (loaded from .env),
# falling back to the config.sh defaults under $SDK_ROOT.
# Repos with uncommitted changes are skipped, never clobbered.
Expand All @@ -18,24 +19,45 @@ if [[ -f "$SCRIPT_DIR/.env" ]]; then
set +a
fi

# var|default-subpath|kind (kind: rel = latest rel/* branch, tag = latest semver tag)
# sdk|var|default-subpath|kind (kind: rel = latest rel/* branch, tag = latest semver tag)
# Defaults mirror run-local/config.sh; override any via *_DIR in .env.
REPOS=(
"FLUTTER_DIR|OneSignal-Flutter-SDK|rel"
"RN_DIR|react-native-onesignal|rel"
"CORDOVA_DIR|OneSignal-Cordova-SDK|rel"
"CAPACITOR_DIR|OneSignal-Capacitor-SDK|rel"
"DOTNET_DIR|DotNet/OneSignal-DotNet-SDK|rel"
"UNITY_DIR|OneSignal-Unity-SDK|rel"
"ANDROID_DIR|OneSignal-Android-SDK|rel"
"EXPO_DIR|onesignal-expo-plugin|tag"
"IOS_DIR|OneSignal-iOS-SDK|tag"
"flutter|FLUTTER_DIR|OneSignal-Flutter-SDK|rel"
"react-native|RN_DIR|react-native-onesignal|rel"
"cordova|CORDOVA_DIR|OneSignal-Cordova-SDK|rel"
"capacitor|CAPACITOR_DIR|OneSignal-Capacitor-SDK|rel"
"dotnet|DOTNET_DIR|DotNet/OneSignal-DotNet-SDK|rel"
"unity|UNITY_DIR|OneSignal-Unity-SDK|rel"
"android|ANDROID_DIR|OneSignal-Android-SDK|rel"
"expo|EXPO_DIR|onesignal-expo-plugin|tag"
"ios|IOS_DIR|OneSignal-iOS-SDK|tag"
)

RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m'

for selected in "$@"; do
case "$selected" in
flutter|react-native|cordova|capacitor|dotnet|unity|android|expo|ios) ;;
*)
echo -e "${RED}FAIL${NC} Unknown SDK: $selected"
exit 2
;;
esac
done

for entry in "${REPOS[@]}"; do
IFS='|' read -r var subpath kind <<< "$entry"
IFS='|' read -r sdk var subpath kind <<< "$entry"
if (( $# > 0 )); then
selected_sdk=false
for selected in "$@"; do
if [[ "$sdk" == "$selected" ]]; then
selected_sdk=true
break
fi
done
[[ "$selected_sdk" == true ]] || continue
fi

p="${!var:-$SDK_ROOT/$subpath}" # .env override wins, else default
name="$(basename "$p")"

Expand Down
8 changes: 4 additions & 4 deletions appium/scripts/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ Options:
Note: 'android' (native) skips --platform=ios and
'ios' (native) skips --platform=android.
--bail Stop after the first failing combo
--release Check out the latest release point in each SDK repo
first (runs checkout-releases.sh; honors *_DIR from
.env). Skips repos with uncommitted changes.
--release Check out the latest release point for the selected
SDK repos first (honors *_DIR from .env). Skips repos
with uncommitted changes.

Options forwarded to run-local.sh:
--skip-build Skip per-app build (reuse existing artifact)
Expand Down Expand Up @@ -119,7 +119,7 @@ fi

if (( RELEASE )); then
echo -e "${BOLD}━━━ Checking out latest releases ━━━${NC}"
if ! "$SCRIPT_DIR/checkout-releases.sh"; then
if ! "$SCRIPT_DIR/checkout-releases.sh" "${SDKS[@]}"; then
error "checkout-releases.sh failed; aborting before running combos"
exit 1
fi
Expand Down
10 changes: 5 additions & 5 deletions appium/scripts/run-local/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Options:
--skip-reset Keep existing app data
--pods Use examples/demo-pods instead of examples/demo for
flutter, cordova, and capacitor SDKs
--release Check out the latest release point in each SDK repo first
--release Check out the latest release point for the selected SDK
--device-real Build & run against a physical iPhone (requires --udid
and XCODE_TEAM_ID). Implies --skip-device. iOS only.
Supported SDKs: cordova, capacitor, react-native, expo.
Expand Down Expand Up @@ -119,10 +119,6 @@ USAGE
esac
done

if [[ "$RELEASE" == true ]]; then
"$SCRIPT_DIR/checkout-releases.sh"
fi

# Ensure values set via CLI flags propagate to wdio (which reads them as env).
export APPIUM_PORT
[[ -n "$WDA_LOCAL_PORT" ]] && export WDA_LOCAL_PORT
Expand Down Expand Up @@ -162,6 +158,10 @@ USAGE
exit 0
fi

if [[ "$RELEASE" == true ]]; then
"$SCRIPT_DIR/checkout-releases.sh" "$SDK_TYPE"
fi

if [[ "$PODS_DEMO" == true ]]; then
case "$SDK_TYPE" in
flutter|cordova|capacitor) ;;
Expand Down