Skip to content

Commit 1e7263f

Browse files
committed
tagging fix
1 parent 52610a2 commit 1e7263f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scripts/setup_quickstart_spm.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ source $scripts_dir/check_secrets.sh
2626
# Arguments:
2727
# SAMPLE: The name of the quickstart sample directory.
2828
# RELEASE_TESTING: Optional. Can be "nightly_release_testing" or "prerelease_testing".
29-
# VERSION: Required when RELEASE_TESTING is "nightly_release_testing".
3029
#
3130
# Environment Variable:
3231
# QUICKSTART_REPO: Optional. Path to a local clone of the quickstart-ios repo.
@@ -35,7 +34,6 @@ source $scripts_dir/check_secrets.sh
3534
# QUICKSTART_REPO=/path/to/my/quickstart-ios ./scripts/setup_quickstart_spm.sh AppName
3635
SAMPLE=$1
3736
RELEASE_TESTING=${2-}
38-
VERSION=${3-}
3937

4038
QUICKSTART_PROJECT_DIR="quickstart-ios/${SAMPLE}"
4139

@@ -80,12 +78,14 @@ if [[ -n "${QUICKSTART_REPO:-}" ]] || check_secrets || [[ ${SAMPLE} == "installa
8078
# (cd "$QUICKSTART_DIR"; git checkout {BRANCH_NAME})
8179

8280
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."
8585
exit 1
8686
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}"
8989
swift run --package-path "$scripts_dir/spm-localizer" SPMLocalize "$ABSOLUTE_PROJECT_FILE" --version "$VERSION"
9090

9191
elif [ "$RELEASE_TESTING" == "prerelease_testing" ]; then

0 commit comments

Comments
 (0)