Skip to content

Commit

Permalink
根据产品线发布版本
Browse files Browse the repository at this point in the history
  • Loading branch information
tonychanchen committed Sep 7, 2021
1 parent 105405e commit d161728
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions .github/script/build_ijk_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
set -e

#rtt=$GIT_BRANCH_IMAGE_VERSION
#rb=$(git rev-parse --abbrev-ref HEAD)
rb=$(git rev-parse --abbrev-ref HEAD)
rc=$(git rev-parse --short HEAD)
currtag=$(git describe --tags `git rev-list --tags --max-count=1`)
currbra=$rb
echo 000---$currtag

./init-ios.sh
Expand Down Expand Up @@ -46,19 +47,37 @@ git commit -m "tencentyun/iot-ijkplayer@$rc"
git push https://$GIT_ACCESS_TOKEN@github.com/tencentyun/iot-thirdparty-ios.git

# ==========此处添加版本自增逻辑,如果是持续集成发snapshot,最新tag+1;如果是发布就发branch
vtag=${currtag#*v}
echo $vtag


branch=${currbra#*v}
vbranch=${branch%x*}0
echo $vbranch

function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }

resultvv=$vbranch
if version_ge $vtag $vbranch; then

echo "$vtag is greater than or equal to $vbranch"

vtaglist=(${vtag//./ })

firsttag=${vtaglist[0]}
secondtag=${vtaglist[1]}
thirdtag=${vtaglist[2]}
thirdtag=`expr $thirdtag + 1`

resultvv=$firsttag.$secondtag.$thirdtag
fi

temptag=$(git describe --tags `git rev-list --tags --max-count=1`)
vtaglist=(${temptag//-/ })
beta=${vtaglist[1]}
version=${vtaglist[0]}
resultvv=${version#*v}
echo "-->>$resultvv"

if [ $1 == 'Debug' ]; then
git tag "$resultvv-beta.$poddatetime"
git tag "ijkplayer-v$resultvv-beta.$poddatetime"
else
vtag=${currtag#*v}
git tag "$vtag"
git tag "ijkplayer-v$vtag"
fi
# ==========此处添加版本自增逻辑,如果是持续集成发snapshot,最新tag+1;如果是发布就发branch

Expand Down

0 comments on commit d161728

Please sign in to comment.