@@ -26,7 +26,6 @@ source $scripts_dir/check_secrets.sh
26
26
# Arguments:
27
27
# SAMPLE: The name of the quickstart sample directory.
28
28
# RELEASE_TESTING: Optional. Can be "nightly_release_testing" or "prerelease_testing".
29
- # VERSION: Required when RELEASE_TESTING is "nightly_release_testing".
30
29
#
31
30
# Environment Variable:
32
31
# QUICKSTART_REPO: Optional. Path to a local clone of the quickstart-ios repo.
@@ -35,7 +34,6 @@ source $scripts_dir/check_secrets.sh
35
34
# QUICKSTART_REPO=/path/to/my/quickstart-ios ./scripts/setup_quickstart_spm.sh AppName
36
35
SAMPLE=$1
37
36
RELEASE_TESTING=${2-}
38
- VERSION=${3-}
39
37
40
38
QUICKSTART_PROJECT_DIR=" quickstart-ios/${SAMPLE} "
41
39
@@ -80,12 +78,14 @@ if [[ -n "${QUICKSTART_REPO:-}" ]] || check_secrets || [[ ${SAMPLE} == "installa
80
78
# (cd "$QUICKSTART_DIR"; git checkout {BRANCH_NAME})
81
79
82
80
if [ " $RELEASE_TESTING " == " nightly_release_testing" ]; then
83
- if [[ -z " $VERSION " ]]; then
84
- echo " Error: VERSION (arg 3) is required for nightly_release_testing."
81
+ # For release testing, find the latest CocoaPods tag and extract the version.
82
+ LATEST_TAG=$( git tag -l " CocoaPods-*" --sort=-v:refname | awk ' /^CocoaPods-[0-9]+\.[0-9]+\.[0-9]+$/ { print; exit }' )
83
+ if [[ -z " $LATEST_TAG " ]]; then
84
+ echo " Error: Could not find a 'CocoaPods-X.Y.Z' tag."
85
85
exit 1
86
86
fi
87
- # For release testing, point to the specific version tag.
88
- echo " Setting SPM dependency to version ${VERSION} "
87
+ VERSION= $( echo " $LATEST_TAG " | sed ' s/CocoaPods-// ' )
88
+ echo " Setting SPM dependency to latest version: ${VERSION} "
89
89
swift run --package-path " $scripts_dir /spm-localizer" SPMLocalize " $ABSOLUTE_PROJECT_FILE " --version " $VERSION "
90
90
91
91
elif [ " $RELEASE_TESTING " == " prerelease_testing" ]; then
0 commit comments