From 7aa733b8bd476d90dd51646211c59ba3bbd11c6f Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Wed, 21 Apr 2021 23:09:33 +1200 Subject: [PATCH] Updated pipeline tasks to latest version (#257) --- CHANGELOG.md | 1 + README.md | 1 - azure-pipelines.yml | 93 ++++++++++++++++----------------------------- 3 files changed, 34 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48f813b..06a4028 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added support for publishing code coverage to `CodeCov.io` and Azure Pipelines - Fixes [Issue #255](https://github.com/dsccommunity/StorageDsc/issues/255). - Updated build to use `Sampler.GitHubTasks` - Fixes [Issue #254](https://github.com/dsccommunity/StorageDsc/issues/254). +- Updated pipeline tasks to latest pattern. ### Fixed diff --git a/README.md b/README.md index e30bd98..b8d6e2a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ [![PowerShell Gallery (with prereleases)](https://img.shields.io/powershellgallery/vpre/StorageDsc?label=StorageDsc%20Preview)](https://www.powershellgallery.com/packages/StorageDsc/) [![PowerShell Gallery](https://img.shields.io/powershellgallery/v/StorageDsc?label=StorageDsc)](https://www.powershellgallery.com/packages/StorageDsc/) [![codecov](https://codecov.io/gh/dsccommunity/StorageDsc/branch/main/graph/badge.svg)](https://codecov.io/gh/dsccommunity/StorageDsc) -![Azure DevOps coverage (branch)](https://img.shields.io/azure-devops/coverage/dsccommunity/StorageDsc/14/main) ## Code of Conduct diff --git a/azure-pipelines.yml b/azure-pipelines.yml index da69217..753e871 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -43,12 +43,13 @@ stages: env: ModuleVersion: $(gitVersion.Informationalversion) - - task: PublishBuildArtifacts@1 - displayName: 'Publish Build Artifact' + - task: PublishPipelineArtifact@1 + displayName: 'Publish Pipeline Artifact' inputs: - PathtoPublish: 'output/' - ArtifactName: 'output' - publishLocation: 'Container' + targetPath: '$(buildFolderName)/' + artifact: $(buildArtifactName) + publishLocation: 'pipeline' + parallel: true - stage: Test dependsOn: Build @@ -59,13 +60,12 @@ stages: vmImage: 'windows-2019' timeoutInMinutes: 0 steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifact' + - task: DownloadPipelineArtifact@2 + displayName: 'Download Pipeline Artifact' inputs: buildType: 'current' - downloadType: 'single' - artifactName: 'output' - downloadPath: '$(Build.SourcesDirectory)' + artifactName: $(buildArtifactName) + targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)' - task: PowerShell@2 name: test @@ -89,20 +89,12 @@ stages: vmImage: 'vs2017-win2016' timeoutInMinutes: 0 steps: - - powershell: | - $repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/' - echo "##vso[task.setvariable variable=RepositoryOwner;isOutput=true]$repositoryOwner" - echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName" - name: dscBuildVariable - displayName: 'Set Environment Variables' - - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifact' + - task: DownloadPipelineArtifact@2 + displayName: 'Download Pipeline Artifact' inputs: buildType: 'current' - downloadType: 'single' - artifactName: 'output' - downloadPath: '$(Build.SourcesDirectory)' + artifactName: $(buildArtifactName) + targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)' - task: PowerShell@2 name: test @@ -134,20 +126,12 @@ stages: vmImage: 'ubuntu 16.04' timeoutInMinutes: 0 steps: - - pwsh: | - $repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/' - echo "##vso[task.setvariable variable=RepositoryOwner;isOutput=true]$repositoryOwner" - echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName" - name: dscBuildVariable - displayName: 'Set Environment Variables' - - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifact' + - task: DownloadPipelineArtifact@2 + displayName: 'Download Pipeline Artifact' inputs: buildType: 'current' - downloadType: 'single' artifactName: $(buildArtifactName) - downloadPath: '$(Build.SourcesDirectory)' + targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)' - task: DownloadPipelineArtifact@2 displayName: 'Download Test Artifact' @@ -173,13 +157,12 @@ stages: vmImage: 'vs2017-win2016' timeoutInMinutes: 0 steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifact' + - task: DownloadPipelineArtifact@2 + displayName: 'Download Pipeline Artifact' inputs: buildType: 'current' - downloadType: 'single' - artifactName: 'output' - downloadPath: '$(Build.SourcesDirectory)' + artifactName: $(buildArtifactName) + targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)' - task: PowerShell@2 name: configureWinRM @@ -211,20 +194,12 @@ stages: vmImage: 'windows-2019' timeoutInMinutes: 0 steps: - - powershell: | - $repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/' - echo "##vso[task.setvariable variable=RepositoryOwner;isOutput=true]$repositoryOwner" - echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName" - name: dscBuildVariable - displayName: 'Set Environment Variables' - - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifact' + - task: DownloadPipelineArtifact@2 + displayName: 'Download Pipeline Artifact' inputs: buildType: 'current' - downloadType: 'single' - artifactName: 'output' - downloadPath: '$(Build.SourcesDirectory)' + artifactName: $(buildArtifactName) + targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)' - task: PowerShell@2 name: test @@ -248,13 +223,12 @@ stages: vmImage: 'windows-2019' timeoutInMinutes: 0 steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifact' + - task: DownloadPipelineArtifact@2 + displayName: 'Download Pipeline Artifact' inputs: buildType: 'current' - downloadType: 'single' - artifactName: 'output' - downloadPath: '$(Build.SourcesDirectory)' + artifactName: $(buildArtifactName) + targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)' - task: PowerShell@2 name: configureWinRM @@ -297,13 +271,12 @@ stages: pool: vmImage: 'ubuntu 16.04' steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifact' + - task: DownloadPipelineArtifact@2 + displayName: 'Download Pipeline Artifact' inputs: buildType: 'current' - downloadType: 'single' - artifactName: 'output' - downloadPath: '$(Build.SourcesDirectory)' + artifactName: $(buildArtifactName) + targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)' - task: PowerShell@2 name: publishRelease