Improve build pipeline

This commit is contained in:
Mark McDowall 2022-08-22 22:11:34 -07:00
parent dc44cbcda6
commit b5439a0661
3 changed files with 29 additions and 26 deletions

View File

@ -40,13 +40,6 @@ EnableBsdSupport()
fi
}
SetExecutableBits()
{
find . -name "ffprobe" -exec chmod a+x {} \;
find . -name "Sonarr" -exec chmod a+x {} \;
find . -name "Sonarr.Update" -exec chmod a+x {} \;
}
LintUI()
{
ProgressStart 'ESLint'
@ -110,7 +103,11 @@ PackageFiles()
mkdir -p $folder
cp -r $outputFolder/$framework/$runtime/publish/* $folder
cp -r $outputFolder/Sonarr.Update/$framework/$runtime/publish $folder/Sonarr.Update
if [ "$FRONTEND" = "YES" ];
then
cp -r $outputFolder/UI $folder
fi
echo "Adding LICENSE"
cp LICENSE.md $folder
@ -235,7 +232,6 @@ Package()
;;
osx)
PackageMacOS "$framework" "$runtime"
PackageMacOSApp "$framework" "$runtime"
;;
esac
}
@ -280,21 +276,28 @@ UploadArtifacts()
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']"
echo "##teamcity[publishArtifacts '$artifactsFolder/$runtime/$framework/** => Sonarr.$BRANCH.$SONARR_VERSION.$runtime.zip']"
done
# Debian Package
# Debian Package / Windows installer / macOS app
echo "##teamcity[publishArtifacts 'distribution/** => distribution.zip']"
ProgressEnd 'Publishing Artifacts'
}
UploadUIArtifacts()
{
local framework="$1"
ProgressStart 'Publishing UI Artifacts'
# UI folder
echo "##teamcity[publishArtifacts '$outputFolder/UI/** => UI.zip']"
ProgressEnd 'Publishing UI Artifacts'
}
# Use mono or .net depending on OS
case "$(uname -s)" in
CYGWIN*|MINGW32*|MINGW64*|MSYS*)
@ -397,12 +400,6 @@ then
UploadTestArtifacts "net6.0"
fi
if [ "$FRONTEND" = "YES" ];
then
YarnInstall
RunWebpack
fi
if [ "$LINT" = "YES" ];
then
if [ -z "$FRONTEND" ];
@ -413,10 +410,16 @@ then
LintUI
fi
if [ "$FRONTEND" = "YES" ];
then
YarnInstall
RunWebpack
UploadUIArtifacts
fi
if [ "$PACKAGES" = "YES" ];
then
UpdateVersionNumber
SetExecutableBits
if [[ -z "$RID" || -z "$FRAMEWORK" ]];
then

View File

@ -1,4 +1,4 @@
REM SET BUILD_NUMBER=1
REM SET SONARR_VERSION=1
REM SET BRANCH=develop
echo ##teamcity[progressStart 'Building setup file']
inno\ISCC.exe sonarr.iss

View File

@ -7,7 +7,7 @@
#define ForumsURL "https://forums.sonarr.tv/"
#define AppExeName "Sonarr.exe"
#define BuildNumber "3.0"
#define BuildNumber GetEnv('BUILD_NUMBER')
#define BuildNumber GetEnv('SONARR_VERSION')
#define BranchName GetEnv('BRANCH')
#define Framework GetEnv('FRAMEWORK')
#define Runtime GetEnv('RUNTIME')