Skip to content

Commit

Permalink
ci: fix problem detecting tag branch when uploading to Azure
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoody committed Oct 9, 2019
1 parent 7959859 commit 57d0322
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/ci/az-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ VERSION=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" ${INFO_
XC_VERSION=$(/usr/libexec/PlistBuddy -c "Print :DTXcode" ${INFO_PLIST})
XC_BUILD=$(/usr/libexec/PlistBuddy -c "Print :DTXcodeBuild" ${INFO_PLIST})

# Xcode 10.3 reports as 1030, which is confusing
# When building any XCUITest runner, Xcode 10.3 reports as 1020.
if [[ "${XC_VERSION}" = "1020" && "${XC_BUILD}" = "10G1d" ]]; then
XC_VERSION="1030"
fi

# In ADO pipelines, the GIT_BRANCH does not match 'tag/'.
# SOURCE_BRANCH is an env variable provided by the ADO pipeline.
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "${GIT_BRANCH}" =~ "tag/" ]]; then
if [[ "${GIT_BRANCH}" =~ "tag/" || "${SOURCE_BRANCH}" =~ "refs/tags" ]]; then
BUILD_ID="DeviceAgent-${VERSION}-Xcode-${XC_VERSION}-${GIT_SHA}"
else
BUILD_ID="DeviceAgent-${VERSION}-Xcode-${XC_VERSION}-${GIT_SHA}-AdHoc"
Expand Down

0 comments on commit 57d0322

Please sign in to comment.