From b36de61a8af5a0adcd831ccdb433135d95248596 Mon Sep 17 00:00:00 2001 From: Ray Chen Date: Thu, 1 Feb 2024 08:16:34 +0800 Subject: [PATCH] Added spec location verification to the release pipeline (#22301) * publish package info as artifact * Added the same condition as previous step --- eng/pipelines/templates/jobs/archetype-go-release.yml | 10 ++++++++++ eng/pipelines/templates/steps/analyze.yml | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/templates/jobs/archetype-go-release.yml b/eng/pipelines/templates/jobs/archetype-go-release.yml index 4af652604bb8..ba48fa04e1aa 100644 --- a/eng/pipelines/templates/jobs/archetype-go-release.yml +++ b/eng/pipelines/templates/jobs/archetype-go-release.yml @@ -56,6 +56,8 @@ stages: deploy: steps: - checkout: self + - download: current + artifact: 'PackageInfo' - template: /eng/common/pipelines/templates/steps/retain-run.yml - template: /eng/common/pipelines/templates/steps/verify-changelog.yml parameters: @@ -64,6 +66,14 @@ stages: ${{ else }}: PackageName: 'sdk/${{parameters.ServiceDirectory}}' ForRelease: true + - template: /eng/common/pipelines/templates/steps/verify-restapi-spec-location.yml + parameters: + ${{ if startsWith(parameters.ServiceDirectory, '../') }}: + PackageName: "${{replace(parameters.ServiceDirectory, '../', '')}}" + ${{ else }}: + PackageName: 'sdk/${{parameters.ServiceDirectory}}' + ServiceDirectory: ${{parameters.ServiceDirectory}} + ArtifactLocation: $(Pipeline.Workspace) - task: PowerShell@2 displayName: 'Verify no replace directives in go.mod file' inputs: diff --git a/eng/pipelines/templates/steps/analyze.yml b/eng/pipelines/templates/steps/analyze.yml index 85390cdf5180..e5e1393a2531 100644 --- a/eng/pipelines/templates/steps/analyze.yml +++ b/eng/pipelines/templates/steps/analyze.yml @@ -18,7 +18,12 @@ steps: workingDirectory: $(Pipeline.Workspace) displayName: Dump Package properties condition: and(succeeded(), ${{ parameters.IsSdkLibrary }}) - + - task: PublishPipelineArtifact@1 + condition: and(succeeded(), ${{ parameters.IsSdkLibrary }}) + displayName: 'Publish PackageInfo Artifacts' + inputs: + artifactName: 'PackageInfo' + path: $(Build.ArtifactStagingDirectory)/PackageInfo - template: /eng/common/pipelines/templates/steps/set-default-branch.yml - task: Powershell@2