From 6345d0e73ba70d3b3d4c61f84fefc1bbecff9d8f Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Tue, 20 Nov 2018 21:13:44 +0100 Subject: [PATCH] Replace Major.Minor.Revision in the TC provided BuildNumber with the packageVersion. --- build.sh | 14 ++++++++++++++ version.sh | 8 ++++++++ 2 files changed, 22 insertions(+) create mode 100644 version.sh diff --git a/build.sh b/build.sh index 4cc9a52f0..1f26a7534 100755 --- a/build.sh +++ b/build.sh @@ -14,6 +14,8 @@ updateFolderMono=$outputFolderLinux/Sonarr.Update nuget='tools/nuget/nuget.exe'; vswhere='tools/vswhere/vswhere.exe'; +. ./version.sh + CheckExitCode() { "$@" @@ -37,6 +39,17 @@ ProgressEnd() 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() { local path=$1 @@ -321,6 +334,7 @@ case "$(uname -s)" in ;; esac +UpdateVersionNumber Build RunGulp PackageMono diff --git a/version.sh b/version.sh new file mode 100644 index 000000000..92237f6bc --- /dev/null +++ b/version.sh @@ -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 +