Build under TeamCity
This commit is contained in:
parent
ebe9215057
commit
35a5462c8f
63
build.sh
63
build.sh
|
@ -7,12 +7,16 @@ artifactsFolder="_artifacts";
|
||||||
|
|
||||||
ProgressStart()
|
ProgressStart()
|
||||||
{
|
{
|
||||||
|
echo "##teamcity[blockOpened name='$1']"
|
||||||
|
echo "##teamcity[progressStart '$1']"
|
||||||
echo "Start '$1'"
|
echo "Start '$1'"
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgressEnd()
|
ProgressEnd()
|
||||||
{
|
{
|
||||||
echo "Finish '$1'"
|
echo "Finish '$1'"
|
||||||
|
echo "##teamcity[progressFinish '$1']"
|
||||||
|
echo "##teamcity[blockClosed name='$1']"
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateVersionNumber()
|
UpdateVersionNumber()
|
||||||
|
@ -21,7 +25,7 @@ UpdateVersionNumber()
|
||||||
echo "Updating Version Info"
|
echo "Updating Version Info"
|
||||||
sed -i'' -e "s/<AssemblyVersion>[0-9.*]\+<\/AssemblyVersion>/<AssemblyVersion>$SONARRVERSION<\/AssemblyVersion>/g" src/Directory.Build.props
|
sed -i'' -e "s/<AssemblyVersion>[0-9.*]\+<\/AssemblyVersion>/<AssemblyVersion>$SONARRVERSION<\/AssemblyVersion>/g" src/Directory.Build.props
|
||||||
sed -i'' -e "s/<AssemblyConfiguration>[\$()A-Za-z-]\+<\/AssemblyConfiguration>/<AssemblyConfiguration>${BUILD_SOURCEBRANCHNAME}<\/AssemblyConfiguration>/g" src/Directory.Build.props
|
sed -i'' -e "s/<AssemblyConfiguration>[\$()A-Za-z-]\+<\/AssemblyConfiguration>/<AssemblyConfiguration>${BUILD_SOURCEBRANCHNAME}<\/AssemblyConfiguration>/g" src/Directory.Build.props
|
||||||
sed -i'' -e "s/<string>10.0.0.0<\/string>/<string>$SONARRVERSION<\/string>/g" distribution/osx/Sonarr.app/Contents/Info.plist
|
sed -i'' -e "s/<string>10.0.0.0<\/string>/<string>$SONARRVERSION<\/string>/g" distribution/macOS/Sonarr.app/Contents/Info.plist
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +162,7 @@ PackageMacOS()
|
||||||
cp $folder/libMonoPosixHelper.* $folder/Sonarr.Update
|
cp $folder/libMonoPosixHelper.* $folder/Sonarr.Update
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ProgressEnd 'Creating MacOS Package'
|
ProgressEnd "Creating $runtime Package for $framework"
|
||||||
}
|
}
|
||||||
|
|
||||||
PackageMacOSApp()
|
PackageMacOSApp()
|
||||||
|
@ -172,7 +176,7 @@ PackageMacOSApp()
|
||||||
|
|
||||||
rm -rf $folder
|
rm -rf $folder
|
||||||
mkdir -p $folder
|
mkdir -p $folder
|
||||||
cp -r distribution/osx/Sonarr.app $folder
|
cp -r distribution/macOS/Sonarr.app $folder
|
||||||
mkdir -p $folder/Sonarr.app/Contents/MacOS
|
mkdir -p $folder/Sonarr.app/Contents/MacOS
|
||||||
|
|
||||||
echo "Copying Binaries"
|
echo "Copying Binaries"
|
||||||
|
@ -181,7 +185,7 @@ PackageMacOSApp()
|
||||||
echo "Removing Update Folder"
|
echo "Removing Update Folder"
|
||||||
rm -r $folder/Sonarr.app/Contents/MacOS/Sonarr.Update
|
rm -r $folder/Sonarr.app/Contents/MacOS/Sonarr.Update
|
||||||
|
|
||||||
ProgressEnd 'Creating macOS App Package'
|
ProgressEnd "Creating $runtime App Package for $framework"
|
||||||
}
|
}
|
||||||
|
|
||||||
PackageWindows()
|
PackageWindows()
|
||||||
|
@ -204,7 +208,7 @@ PackageWindows()
|
||||||
echo "Adding Sonarr.Windows to UpdatePackage"
|
echo "Adding Sonarr.Windows to UpdatePackage"
|
||||||
cp $folder/Sonarr.Windows.* $folder/Sonarr.Update
|
cp $folder/Sonarr.Windows.* $folder/Sonarr.Update
|
||||||
|
|
||||||
ProgressEnd 'Creating Windows Package'
|
ProgressEnd "Creating Windows Package for $framework"
|
||||||
}
|
}
|
||||||
|
|
||||||
Package()
|
Package()
|
||||||
|
@ -234,11 +238,54 @@ PackageTests()
|
||||||
local framework="$1"
|
local framework="$1"
|
||||||
local runtime="$2"
|
local runtime="$2"
|
||||||
|
|
||||||
|
ProgressStart "Creating $runtime Test Package for $framework"
|
||||||
|
|
||||||
cp test.sh "$testPackageFolder/$framework/$runtime/publish"
|
cp test.sh "$testPackageFolder/$framework/$runtime/publish"
|
||||||
|
|
||||||
rm -f $testPackageFolder/$framework/$runtime/*.log.config
|
rm -f $testPackageFolder/$framework/$runtime/*.log.config
|
||||||
|
|
||||||
ProgressEnd 'Creating Test Package'
|
ProgressEnd "Creating $runtime Test Package for $framework"
|
||||||
|
}
|
||||||
|
|
||||||
|
UploadTestArtifacts()
|
||||||
|
{
|
||||||
|
local framework="$1"
|
||||||
|
|
||||||
|
ProgressStart 'Publishing Test Artifacts'
|
||||||
|
|
||||||
|
# Tests
|
||||||
|
for dir in $testPackageFolder/$framework/*
|
||||||
|
do
|
||||||
|
local runtime=$(basename "$dir")
|
||||||
|
echo "##teamcity[publishArtifacts '$testPackageFolder/$framework/$runtime/publish/** => tests.$runtime.zip']"
|
||||||
|
done
|
||||||
|
|
||||||
|
ProgressEnd 'Publishing Test Artifacts'
|
||||||
|
}
|
||||||
|
|
||||||
|
UploadArtifacts()
|
||||||
|
{
|
||||||
|
local framework="$1"
|
||||||
|
|
||||||
|
ProgressStart 'Publishing Artifacts'
|
||||||
|
|
||||||
|
# Releases
|
||||||
|
for dir in $artifactsFolder/*
|
||||||
|
do
|
||||||
|
local runtime=$(basename "$dir")
|
||||||
|
local extension="tar.gz"
|
||||||
|
|
||||||
|
if [[ "$runtime" =~ win-|-app ]]; then
|
||||||
|
extension="zip"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "##teamcity[publishArtifacts '$artifactsFolder/$runtime/$framework/** => Sonarr.$BRANCH.$BUILD_NUMBER.$runtime.$extension']"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Debian Package
|
||||||
|
echo "##teamcity[publishArtifacts 'distribution/** => distribution.zip']"
|
||||||
|
|
||||||
|
ProgressEnd 'Publishing Artifacts'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Use mono or .net depending on OS
|
# Use mono or .net depending on OS
|
||||||
|
@ -336,6 +383,8 @@ then
|
||||||
else
|
else
|
||||||
PackageTests "$FRAMEWORK" "$RID"
|
PackageTests "$FRAMEWORK" "$RID"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
UploadTestArtifacts "net6.0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$FRONTEND" = "YES" ];
|
if [ "$FRONTEND" = "YES" ];
|
||||||
|
@ -376,4 +425,6 @@ then
|
||||||
else
|
else
|
||||||
Package "$FRAMEWORK" "$RID"
|
Package "$FRAMEWORK" "$RID"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
UploadArtifacts "net6.0"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue