Implement prepare for publishing funcitonality

This commit is contained in:
Dimitar Milov
2021-02-17 10:56:22 +02:00
parent 16b3a0fe05
commit f07791e1dd
2 changed files with 33 additions and 7 deletions

3
.gitignore vendored
View File

@@ -48,4 +48,5 @@ $RECYCLE.BIN/
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
.apdisk
/Modules/VMware.vSphere.SsoAdmin/ForPSGallery/VMware.vSphere.SsoAdmin

View File

@@ -3,10 +3,6 @@
# **************************************************************************
param(
[ValidateSet("Debug", "Release")]
[string]
$Configuration = "Release",
[string]
$TestVc,
@@ -14,9 +10,14 @@ param(
$TestVcUser,
[string]
$TestVcPassword
$TestVcPassword,
[switch]
$PrepareForPSGallery
)
$Configuration = "Release"
function Test-BuildToolsAreAvailable {
$dotnetSdk = Get-Command 'dotnet'
if (-not $dotnetSdk) {
@@ -130,6 +131,25 @@ function Test {
}
}
function PrepareForRelease {
$targetRootDirName = 'ForPSGallery'
$releaseDir = Join-Path (Split-Path $PSScriptRoot) $targetRootDirName
if (Test-Path $releaseDir) {
Remove-Item -Path $releaseDir -Recurse
}
New-Item -Path $releaseDir -ItemType Directory | Out-Null
$releaseDir = Join-Path $releaseDir 'VMware.vSphere.SsoAdmin'
New-Item -Path $releaseDir -ItemType Directory | Out-Null
$sourceDir = Split-Path $PSScriptRoot
Get-ChildItem -Path $sourceDir -Exclude src, README.md, $targetRootDirName | `
Copy-Item -Recurse -Destination $releaseDir
$catalogFilePath = Join-path $releaseDir ((Get-Item $releaseDir).Name + ".cat")
New-FileCatalog -Path $releaseDir -CatalogFilePath $catalogFilePath | Out-Null
}
# 1. Test Build Tools
LogInfo "Test build tools are available"
Test-BuildToolsAreAvailable
@@ -144,4 +164,9 @@ LogInfo "Publish binaries to '$OutputFolder'"
Publish $OutputFolder
# 4. Test
Test
Test
# 5. Prepare For Release
if ($PrepareForPSGallery) {
PrepareForRelease
}