Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix oob pipeline #24585

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,7 @@
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)CleanupBuild.ps1 -BuildConfig $(Configuration) -GenerateDocumentationFile $(GenerateDocumentationFile) &quot;" />

<Error Condition="'$(NuGetKey)' == ''" Text="You must provide the NuGetKey parameter to the build: /p:NuGetKey=YOUR_PUBLISHING_KEY" />
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)PublishModules.ps1 -TargetBuild $(TargetBuild) -IsNetCore:$$(NetCore) -BuildConfig $(Configuration) -Scope $(Scope) -ApiKey $(NuGetKey) -RepositoryLocation /&quot;$(NuGetPublishingSource)/&quot;&quot; -NugetExe $(NuGetCommand)" />
</Target>

<Target Name="BuildInstaller" AfterTargets="Publish" Condition="('$(Scope)' == 'All' or '$(Scope)' == 'Latest' or '$(Scope)' == 'Netcore')">
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. Register-PSRepository -Name MSIcreationrepository -SourceLocation $(RepoArtifacts) -InstallationPolicy Trusted &quot;" />
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoRoot)/setup/generate.ps1 -repository MSIcreationrepository &quot;" />
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. Unregister-PSRepository -Name MSIcreationrepository &quot;" />
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)PublishModules.ps1 -TargetBuild $(TargetBuild) -IsNetCore:$$(NetCore) -BuildConfig $(Configuration) -Scope $(Scope) -ApiKey $(NuGetKey) -RepositoryLocation &quot;$(NuGetPublishingSource)&quot;&quot; -NugetExe $(NuGetCommand)" />
</Target>

<Target Name="BuildImages">
Expand Down
2 changes: 1 addition & 1 deletion tools/PublishModules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ if ($PublishLocal) {
$null = New-Item -ItemType Directory -Force -Path $tempRepoPath
$tempRepoName = ([System.Guid]::NewGuid()).ToString()
$repo = Get-PSRepository | Where-Object { $_.SourceLocation -eq $tempRepoPath }
if ($repo -ne $null) {
if ($null -ne $repo) {
$tempRepoName = $repo.Name
} else {
Register-PSRepository -Name $tempRepoName -SourceLocation $tempRepoPath -PublishLocation $tempRepoPath -InstallationPolicy Trusted -PackageManagementProvider NuGet
Expand Down
12 changes: 7 additions & 5 deletions tools/PublishModules.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -275,21 +275,20 @@ function Get-AllModules {
)
Write-Host "Getting Azure client modules"
$clientModules = Get-ClientModules -BuildConfig $BuildConfig -Scope $Scope -PublishLocal:$PublishLocal -IsNetCore:$isNetCore
Write-Host " "

if($clientModules.Length -le 2 -and $TargetBuild -eq "true") {
Write-Host "$clientModules"
if($clientModules.Count -le 2 -and $TargetBuild -eq "true") {
return @{
ClientModules = $clientModules
}
}

Write-Host "Getting admin modules"
$adminModules = Get-AdminModules -BuildConfig $BuildConfig -Scope $Scope
Write-Host " "
Write-Host "$adminModules"

Write-Host "Getting rollup modules"
$rollupModules = Get-RollupModules -BuildConfig $BuildConfig -Scope $Scope -IsNetCore:$isNetCore
Write-Host " "
Write-Host "$rollupModules"

return @{
ClientModules = $clientModules;
Expand Down Expand Up @@ -592,6 +591,9 @@ function Add-AllModules {
foreach ($package in $packages) {
$fileName = $package.Name
$versionString = $fileName.Replace('Az.Accounts.', '').Replace('.nupkg', '')
if ($versionString -match 'preview') {
return
}
$version = [version]$versionString

if ($version -gt $latestVersion) {
Expand Down