mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.4 KiB
50 lines
1.4 KiB
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 |