forked from abpframework/abp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1-fetch-and-build.ps1
50 lines (41 loc) · 1.42 KB
/
1-fetch-and-build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
param(
[string]$branch,
[string]$newVersion
)
. ..\nupkg\common.ps1
if (!$branch)
{
$branch = Read-Host "Enter the branch name"
}
#----------- Read the current version from common.props -----------
$commonPropsFilePath = resolve-path "../common.props"
$commonPropsXmlCurrent = [xml](Get-Content $commonPropsFilePath )
$currentVersion = $commonPropsXmlCurrent.Project.PropertyGroup.Version.Trim()
if (!$newVersion)
{
$newVersion = Read-Host "Current version is '$currentVersion'. Enter the new version (empty for no change) "
if($newVersion -eq "")
{
$newVersion = $currentVersion
}
}
if ($newVersion -ne $currentVersion){
# Update common.props for version attribute
$commonPropsXmlCurrent.Project.PropertyGroup.Version = $newVersion
$commonPropsXmlCurrent.Save( $commonPropsFilePath )
#check if it's updated...
$commonPropsXmlNew = [xml](Get-Content $commonPropsFilePath )
$newVersionAfterUpdate = $commonPropsXmlNew.Project.PropertyGroup.Version
echo "`n`nNew version updated as '$newVersionAfterUpdate' in $commonPropsFilePath`n"
}
################################################################
Write-Info "Pulling ABP $branch branch from GitHub"
cd ..
git switch $branch
git pull origin
################################################################
Write-Info "Building ABP repository"
cd build
.\build-all-release.ps1
Write-Info "Completed: Building ABP repository"
cd ..\deploy #always return to the deploy directory