From b5439a06618809e67031f900882028bde7334bbf Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 22 Aug 2022 22:11:34 -0700 Subject: [PATCH] Improve build pipeline --- build.sh | 49 ++++++++++++++------------- distribution/windows/setup/build.bat | 2 +- distribution/windows/setup/sonarr.iss | 4 +-- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/build.sh b/build.sh index 6593177d9..9e99da279 100755 --- a/build.sh +++ b/build.sh @@ -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 - cp -r $outputFolder/UI $folder + + 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 diff --git a/distribution/windows/setup/build.bat b/distribution/windows/setup/build.bat index fe50347f5..1b28e2331 100644 --- a/distribution/windows/setup/build.bat +++ b/distribution/windows/setup/build.bat @@ -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 diff --git a/distribution/windows/setup/sonarr.iss b/distribution/windows/setup/sonarr.iss index e879a4cf5..09d8d6c38 100644 --- a/distribution/windows/setup/sonarr.iss +++ b/distribution/windows/setup/sonarr.iss @@ -7,13 +7,13 @@ #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') [Setup] -; NOTE: The value of AppId uniquely identifies this application. +; NOTE: The value of AppId uniquely identifies this appl ication. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{56C1065D-3523-4025-B76D-6F73F67F7F71}