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.
abp/npm/publish-ng.ps1

59 lines
1.5 KiB

param(
[string]$Version,
[string]$Registry
)
yarn install
$NextVersion = $(node publish-utils.js --nextVersion)
$RootFolder = (Get-Item -Path "./" -Verbose).FullName
if (-Not $Version) {
$Version = $NextVersion;
}
if (-Not $Registry) {
$Registry = "https://registry.npmjs.org";
}
$UpdateNgPacksCommand = "yarn update-version $Version"
$NgPacksPublishCommand = "npm run publish-packages -- --nextVersion $Version --skipGit --registry $Registry --skipVersionValidation"
$UpdateGulpCommand = "yarn update-gulp --registry $Registry"
3 years ago
$IsPrerelease = $(node publish-utils.js --prerelease --customVersion $Version) -eq "true";
3 years ago
if ($IsPrerelease) {
$UpdateGulpCommand += " --prerelease"
$UpdateNgPacksCommand += " --prerelease"
}
$commands = (
"cd ng-packs",
"yarn install",
$UpdateNgPacksCommand,
"cd scripts",
"yarn install",
$NgPacksPublishCommand,
"cd ../../",
"cd scripts",
"yarn remove-lock-files",
"cd ..",
$UpdateGulpCommand
)
foreach ($command in $commands) {
$timer = [System.Diagnostics.Stopwatch]::StartNew()
Write-Host $command
Invoke-Expression $command
if ($LASTEXITCODE -ne '0' -And $command -notlike '*cd *') {
Write-Host ("Process failed! " + $command)
Set-Location $RootFolder
exit $LASTEXITCODE
}
$timer.Stop()
$total = $timer.Elapsed
Write-Output "-------------------------"
Write-Output "$command command took $total (Hours:Minutes:Seconds.Milliseconds)"
Write-Output "-------------------------"
}