Tweak AppVeyor build version

This commit is contained in:
Alex Barney 2019-02-16 20:50:41 -06:00
parent 199dbf7543
commit 5ec829915d
2 changed files with 19 additions and 15 deletions

View file

@ -56,22 +56,22 @@ export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
if [[ -x "$(command -v dotnet)" && (-z ${DOTNET_VERSION+x} || $(dotnet --version) == "$DOTNET_VERSION") ]]; then if [[ -x "$(command -v dotnet)" && (-z ${DOTNET_VERSION+x} || $(dotnet --version) == "$DOTNET_VERSION") ]]; then
export DOTNET_EXE="$(command -v dotnet)" export DOTNET_EXE="$(command -v dotnet)"
elif [[ ! (-x "$DOTNET_EXE" && (-z ${DOTNET_VERSION+x} || $($DOTNET_EXE --version) == "$DOTNET_VERSION")) ]]; then elif [[ ! (-x "$DOTNET_EXE" && (-z ${DOTNET_VERSION+x} || $($DOTNET_EXE --version) == "$DOTNET_VERSION")) ]]; then
# Download install script # Download install script
DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh" DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh"
mkdir -p "$TEMP_DIRECTORY" mkdir -p "$TEMP_DIRECTORY"
if [ ! -x "$DOTNET_INSTALL_FILE" ]; then if [ ! -x "$DOTNET_INSTALL_FILE" ]; then
curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL" curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL"
chmod +x "$DOTNET_INSTALL_FILE" chmod +x "$DOTNET_INSTALL_FILE"
fi fi
# Install by channel or version # Install by channel or version
if [ -z ${DOTNET_VERSION+x} ]; then if [ -z ${DOTNET_VERSION+x} ]; then
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path
else else
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path
fi fi
fi fi
echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)" echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"

View file

@ -60,7 +60,11 @@ namespace LibHacBuild
.OnlyWhenStatic(() => GitRepository != null) .OnlyWhenStatic(() => GitRepository != null)
.Executes(() => .Executes(() =>
{ {
AppVeyorVersion = $"{GitVersion.AssemblySemVer}-{GitVersion.PreReleaseTag}+{GitVersion.Sha.Substring(0, 8)}"; AppVeyorVersion = $"{GitVersion.AssemblySemVer}";
if (!string.IsNullOrWhiteSpace(GitVersion.PreReleaseTag))
{
AppVeyorVersion += $"-{GitVersion.PreReleaseTag}+{GitVersion.Sha.Substring(0, 8)}";
}
string suffix = GitVersion.PreReleaseTag; string suffix = GitVersion.PreReleaseTag;