From a16088fb663b698f00ad0e89f049e31286bb952d Mon Sep 17 00:00:00 2001 From: Justin Paul Date: Tue, 23 Jan 2024 19:17:27 -0500 Subject: [PATCH] Update azure-pipelines.yml --- azure-pipelines.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3a64d22..fb8bfa6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -57,6 +57,12 @@ jobs: testRunTitle: "PSCore_Win2016_Built" displayName: "Publish Test Results" condition: always() + # Publish module as an artifact + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: "publish/ZertoApiWrapper" + ArtifactName: "ZertoApiWrapper" + publishLocation: "Container" # Linux Build Job - job: Build_PSCore_Ubuntu @@ -115,8 +121,16 @@ jobs: pool: vmImage: 'windows-latest' steps: + # Download the artifact + - task: DownloadBuildArtifacts@0 + inputs: + artifactName: 'ZertoApiWrapper' # The name of the artifact you specified in the build job + downloadPath: '$(Build.ArtifactStagingDirectory)' + + # Publish the module to the PowerShell Gallery - powershell: | Install-Module -Name PowerShellGet -Force -Scope CurrentUser + $env:PSModulePath = "$(Build.ArtifactStagingDirectory);"+$env:PSModulePath $apiKey = "$(PowerShellGalleryApiKey)" - Publish-Module -Name 'ZertoApiWrapper' -NuGetApiKey $apiKey + Publish-Module -Name 'ZertoApiWrapper' -Path "$(Build.ArtifactStagingDirectory)/ZertoApiWrapper" -NuGetApiKey $apiKey displayName: 'Publish to PowerShell Gallery'