Skip to content

Commit

Permalink
Add logic to publish artifact (actions#6821)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim-lobanov authored and ddobranic committed Jan 6, 2023
1 parent 8f98938 commit 223cdd3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
32 changes: 30 additions & 2 deletions images.CI/linux-and-win/azure-pipelines/image-generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,41 @@ jobs:
env:
PACKER_LOG: 1
PACKER_LOG_PATH: $(Build.ArtifactStagingDirectory)/packer-log.txt

- task: PowerShell@2
displayName: 'Copy image artifacts to the separate directory'
inputs:
targetType: 'inline'
script: |
$readmePath = Join-Path "$(TemplateDirectoryPath)" "${{ parameters.image_readme_name }}"
$softwareReportPath = Join-Path "$(TemplateDirectoryPath)" "software-report.json"
Copy-Item -Path $readmePath -Destination "$(Build.ArtifactStagingDirectory)/"
if (Test-Path $softwareReportPath) {
Copy-Item -Path $softwareReportPath -Destination "$(Build.ArtifactStagingDirectory)/"
}
- task: PowerShell@2
displayName: 'Print markdown software report'
inputs:
targetType: 'inline'
script: |
Get-Content -Path "$(Build.ArtifactStagingDirectory)/${{ parameters.image_readme_name }}"
- task: PowerShell@2
displayName: 'Output Readme file content'
displayName: 'Print json software report'
inputs:
targetType: 'inline'
script: |
Get-Content -Path (Join-Path "$(TemplateDirectoryPath)" "${{ parameters.image_readme_name }}")
$softwareReportPath = "$(Build.ArtifactStagingDirectory)/software-report.json"
if (Test-Path $softwareReportPath) {
Get-Content -Path $softwareReportPath
}
- task: PublishBuildArtifacts@1
inputs:
ArtifactName: 'Built_VM_Artifacts'
displayName: Publish Artifacts

- task: PowerShell@2
displayName: 'Print provisioners duration'
Expand Down
2 changes: 1 addition & 1 deletion images.CI/macos/azure-pipelines/image-generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
- bash: |
cat "$(Build.ArtifactStagingDirectory)/systeminfo.json"
displayName: Print json software report
displayName: Print json software report
- task: PublishBuildArtifacts@1
inputs:
Expand Down

0 comments on commit 223cdd3

Please sign in to comment.