Skip to content

Commit

Permalink
Update azure-pipelines.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
apudovkin-ms committed Sep 16, 2024
1 parent 1d796f5 commit e510056
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,48 @@ extends:
filePath: scripts/ci/version.sh
arguments: $(Build.BuildNumber)
script: >
#!/usr/bin/env bash # Update the version strings in the source code # Input: # $1 - the version string, if omitted, use ${BUILD_BUILDID} version=$1 if [ -z ${version} ]; then
#!/usr/bin/env bash
# Update the version strings in the source code
# Input:
# $1 - the version string, if omitted, use ${BUILD_BUILDID}
version=$1
if [ -z ${version} ]; then
version=${BUILD_BUILDID}
fi if [ -z ${version} ]; then
fi

if [ -z ${version} ]; then
echo 'Missing version string'
exit 1
fi echo "Add dev version suffix: $version" platform=`uname` echo "Platform: $platform" pattern="s/^VERSION = [\"']\(.*\)[\"']/VERSION = \"\1.dev$version\"/" if [ "${platform}" == "MSYS_NT-10.0" ]; then
fi

echo "Add dev version suffix: $version"

platform=`uname`

echo "Platform: $platform"

pattern="s/^VERSION = [\"']\(.*\)[\"']/VERSION = \"\1.dev$version\"/"

if [ "${platform}" == "MSYS_NT-10.0" ]; then
# On preview version of sh build task, the script will pick up the wrong version of find.exe
find="C:\Program Files\Git\usr\bin\find.exe"
else
find="find"
fi for each in $("${find}" . -name setup.py); do
fi

for each in $("${find}" . -name setup.py); do
if [ "$platform" == "Darwin" ]; then
sed -i "" "${pattern}" "${each}"
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
else
sed -i "${pattern}" "${each}"
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
fi
done for each in $("${find}" . -name version.py); do
done


for each in $("${find}" . -name version.py); do
if [ "$platform" == "Darwin" ]; then
sed -i "" "${pattern}" "${each}"
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
Expand Down

0 comments on commit e510056

Please sign in to comment.