From 53c3cf76732f0a5d96559af0da67533c7a11cf9c Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Wed, 19 Aug 2020 00:12:27 +0300 Subject: [PATCH] ci: improve the publish.ps1 to be able to publish rc packages --- npm/publish.ps1 | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/npm/publish.ps1 b/npm/publish.ps1 index d507d00c4d..f878860369 100644 --- a/npm/publish.ps1 +++ b/npm/publish.ps1 @@ -4,21 +4,31 @@ param( npm install -$NextVersion = $(node get-version.js) -$rootFolder = (Get-Item -Path "./" -Verbose).FullName +$NextVersion = $(node publish-utils.js --nextVersion) +$RootFolder = (Get-Item -Path "./" -Verbose).FullName if(-Not $Version) { $Version = $NextVersion; } +$NgPacksPublishCommand = "npm run publish-packages -- --nextVersion $Version --skipGit" +$PacksPublishCommand = "npm run lerna -- exec 'npm publish --registry https://registry.npmjs.org'" + +$IsRc = $(node publish-utils.js --rc) -eq "true"; + +if($IsRc) { + $NgPacksPublishCommand += " --rc" + $PacksPublishCommand = $PacksPublishCommand.Substring(0,$PacksPublishCommand.Length-1) + " --tag next'" +} + $commands = ( "cd ng-packs\scripts", "npm install", - "npm run publish-packages -- --nextVersion $Version", + $NgPacksPublishCommand, "cd ../../", "npm run lerna -- version $Version --yes --no-commit-hooks --skip-git --force-publish", "npm run replace-with-tilde", - "npm run lerna -- exec 'npm publish --registry https://registry.npmjs.org'", + $PacksPublishCommand, "npm run update-gulp" ) @@ -27,7 +37,7 @@ foreach ($command in $commands) { Invoke-Expression $command if($LASTEXITCODE -ne '0' -And $command -notlike '*cd *'){ Write-Host ("Process failed! " + $command) - Set-Location $rootFolder + Set-Location $RootFolder exit $LASTEXITCODE } } \ No newline at end of file