Replace Major.Minor.Revision in the TC provided BuildNumber with the packageVersion.

This commit is contained in:
Taloth Saldono 2018-11-20 21:13:44 +01:00
parent 7f5c1b0d5f
commit 6345d0e73b
2 changed files with 22 additions and 0 deletions

View File

@ -14,6 +14,8 @@ updateFolderMono=$outputFolderLinux/Sonarr.Update
nuget='tools/nuget/nuget.exe'; nuget='tools/nuget/nuget.exe';
vswhere='tools/vswhere/vswhere.exe'; vswhere='tools/vswhere/vswhere.exe';
. ./version.sh
CheckExitCode() CheckExitCode()
{ {
"$@" "$@"
@ -37,6 +39,17 @@ ProgressEnd()
echo "##teamcity[blockClosed name='$1']" echo "##teamcity[blockClosed name='$1']"
} }
UpdateVersionNumber()
{
if [ "$BUILD_NUMBER" != "" ]; then
verMajorMinorRevision=`echo "$buildVersion" | cut -d. -f1,2,3`
verBuild=`echo "$BUILD_NUMBER" | cut -d. -f4`
BUILD_NUMBER=$verMajorMinorRevision.$verBuild
echo "##teamcity[buildNumber '$BUILD_NUMBER']"
sed -i "s/^[[]assembly: Assembly\(File\|Informational\)\?Version[(]\"[0-9.*]\+\"[)]/[assembly: Assembly\1Version(\"$BUILD_NUMBER\")/g" ./src/**/Properties/AssemblyInfo.cs ./src/Common/CommonVersionInfo.cs
fi
}
CleanFolder() CleanFolder()
{ {
local path=$1 local path=$1
@ -321,6 +334,7 @@ case "$(uname -s)" in
;; ;;
esac esac
UpdateVersionNumber
Build Build
RunGulp RunGulp
PackageMono PackageMono

8
version.sh Normal file
View File

@ -0,0 +1,8 @@
#! /bin/bash
# Increment packageVersion when package scripts change
packageVersion='3.0.1'
# For now we keep the build version and package version the same
buildVersion=$packageVersion