Improve build pipeline
This commit is contained in:
parent
dc44cbcda6
commit
b5439a0661
47
build.sh
47
build.sh
|
@ -40,13 +40,6 @@ EnableBsdSupport()
|
||||||
fi
|
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()
|
LintUI()
|
||||||
{
|
{
|
||||||
ProgressStart 'ESLint'
|
ProgressStart 'ESLint'
|
||||||
|
@ -110,7 +103,11 @@ PackageFiles()
|
||||||
mkdir -p $folder
|
mkdir -p $folder
|
||||||
cp -r $outputFolder/$framework/$runtime/publish/* $folder
|
cp -r $outputFolder/$framework/$runtime/publish/* $folder
|
||||||
cp -r $outputFolder/Sonarr.Update/$framework/$runtime/publish $folder/Sonarr.Update
|
cp -r $outputFolder/Sonarr.Update/$framework/$runtime/publish $folder/Sonarr.Update
|
||||||
|
|
||||||
|
if [ "$FRONTEND" = "YES" ];
|
||||||
|
then
|
||||||
cp -r $outputFolder/UI $folder
|
cp -r $outputFolder/UI $folder
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Adding LICENSE"
|
echo "Adding LICENSE"
|
||||||
cp LICENSE.md $folder
|
cp LICENSE.md $folder
|
||||||
|
@ -235,7 +232,6 @@ Package()
|
||||||
;;
|
;;
|
||||||
osx)
|
osx)
|
||||||
PackageMacOS "$framework" "$runtime"
|
PackageMacOS "$framework" "$runtime"
|
||||||
PackageMacOSApp "$framework" "$runtime"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
@ -280,21 +276,28 @@ UploadArtifacts()
|
||||||
for dir in $artifactsFolder/*
|
for dir in $artifactsFolder/*
|
||||||
do
|
do
|
||||||
local runtime=$(basename "$dir")
|
local runtime=$(basename "$dir")
|
||||||
local extension="tar.gz"
|
|
||||||
|
|
||||||
if [[ "$runtime" =~ win-|-app ]]; then
|
echo "##teamcity[publishArtifacts '$artifactsFolder/$runtime/$framework/** => Sonarr.$BRANCH.$SONARR_VERSION.$runtime.zip']"
|
||||||
extension="zip"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "##teamcity[publishArtifacts '$artifactsFolder/$runtime/$framework/** => Sonarr.$BRANCH.$BUILD_NUMBER.$runtime.$extension']"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Debian Package
|
# Debian Package / Windows installer / macOS app
|
||||||
echo "##teamcity[publishArtifacts 'distribution/** => distribution.zip']"
|
echo "##teamcity[publishArtifacts 'distribution/** => distribution.zip']"
|
||||||
|
|
||||||
ProgressEnd 'Publishing Artifacts'
|
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
|
# Use mono or .net depending on OS
|
||||||
case "$(uname -s)" in
|
case "$(uname -s)" in
|
||||||
CYGWIN*|MINGW32*|MINGW64*|MSYS*)
|
CYGWIN*|MINGW32*|MINGW64*|MSYS*)
|
||||||
|
@ -397,12 +400,6 @@ then
|
||||||
UploadTestArtifacts "net6.0"
|
UploadTestArtifacts "net6.0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$FRONTEND" = "YES" ];
|
|
||||||
then
|
|
||||||
YarnInstall
|
|
||||||
RunWebpack
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$LINT" = "YES" ];
|
if [ "$LINT" = "YES" ];
|
||||||
then
|
then
|
||||||
if [ -z "$FRONTEND" ];
|
if [ -z "$FRONTEND" ];
|
||||||
|
@ -413,10 +410,16 @@ then
|
||||||
LintUI
|
LintUI
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$FRONTEND" = "YES" ];
|
||||||
|
then
|
||||||
|
YarnInstall
|
||||||
|
RunWebpack
|
||||||
|
UploadUIArtifacts
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$PACKAGES" = "YES" ];
|
if [ "$PACKAGES" = "YES" ];
|
||||||
then
|
then
|
||||||
UpdateVersionNumber
|
UpdateVersionNumber
|
||||||
SetExecutableBits
|
|
||||||
|
|
||||||
if [[ -z "$RID" || -z "$FRAMEWORK" ]];
|
if [[ -z "$RID" || -z "$FRAMEWORK" ]];
|
||||||
then
|
then
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
REM SET BUILD_NUMBER=1
|
REM SET SONARR_VERSION=1
|
||||||
REM SET BRANCH=develop
|
REM SET BRANCH=develop
|
||||||
echo ##teamcity[progressStart 'Building setup file']
|
echo ##teamcity[progressStart 'Building setup file']
|
||||||
inno\ISCC.exe sonarr.iss
|
inno\ISCC.exe sonarr.iss
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
#define ForumsURL "https://forums.sonarr.tv/"
|
#define ForumsURL "https://forums.sonarr.tv/"
|
||||||
#define AppExeName "Sonarr.exe"
|
#define AppExeName "Sonarr.exe"
|
||||||
#define BuildNumber "3.0"
|
#define BuildNumber "3.0"
|
||||||
#define BuildNumber GetEnv('BUILD_NUMBER')
|
#define BuildNumber GetEnv('SONARR_VERSION')
|
||||||
#define BranchName GetEnv('BRANCH')
|
#define BranchName GetEnv('BRANCH')
|
||||||
#define Framework GetEnv('FRAMEWORK')
|
#define Framework GetEnv('FRAMEWORK')
|
||||||
#define Runtime GetEnv('RUNTIME')
|
#define Runtime GetEnv('RUNTIME')
|
||||||
|
|
||||||
[Setup]
|
[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.
|
; Do not use the same AppId value in installers for other applications.
|
||||||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
||||||
AppId={{56C1065D-3523-4025-B76D-6F73F67F7F71}
|
AppId={{56C1065D-3523-4025-B76D-6F73F67F7F71}
|
||||||
|
|
Loading…
Reference in New Issue