From 295c3baf9bdf0004c1ed91243835a648e1254c9f Mon Sep 17 00:00:00 2001 From: Patrick Hallisey Date: Mon, 13 Sep 2021 11:01:50 -0700 Subject: [PATCH] Use publish-artifact template and unique artifact names for gpg artifacts (#24059) --- eng/pipelines/partner-release.yml | 7 ++++--- .../archetype-java-release-pom-only.yml | 16 +++++++------- .../stages/archetype-java-release.yml | 21 +++++++++++-------- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/eng/pipelines/partner-release.yml b/eng/pipelines/partner-release.yml index 9ae1a66f753d9..e89cbe5b6b78f 100644 --- a/eng/pipelines/partner-release.yml +++ b/eng/pipelines/partner-release.yml @@ -59,6 +59,7 @@ steps: JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java ShouldPublish: ${{ parameters.ShouldPublish }} StageOnly: ${{ parameters.StageOnly }} -- publish: $(Artifacts) - artifact: packages-mavencentral - displayName: 'Store gpg signed packages in packages-mavencentral artifact' \ No newline at end of file +- template: /eng/common/pipelines/templates/steps/publish-artifact.yml + parameters: + ArtifactName: packages-mavencentral-$(System.JobAttempt) + ArtifactPath: $(Artifacts) \ No newline at end of file diff --git a/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml b/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml index d7cae3ffbd962..3dff4770b9a48 100644 --- a/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml +++ b/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml @@ -103,9 +103,10 @@ stages: Target: MavenCentral BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - publish: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed - artifact: ${{parameters.ArtifactName}}-mavencentral - displayName: 'Store gpg signed packages in ${{parameters.ArtifactName}}-mavencentral artifact' + - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + parameters: + ArtifactName: ${{parameters.ArtifactName}}-${{artifact.name}}-mavencentral-$(System.JobAttempt) + ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed # After publishing to Maven, publish to the azure-sdk-for-java feed. The reason for # this is that the azure-sdk-for-java feed will have the package available immediately # whereas Maven can take several hours for the package to become available. @@ -117,7 +118,8 @@ stages: RepositoryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-java/maven/v1 Target: JavaDevFeed BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools - JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - publish: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed - artifact: ${{parameters.ArtifactName}}-javadevfeed - displayName: 'Store gpg signed packages in ${{parameters.ArtifactName}}-javadevfeed artifact' + JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java + - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + parameters: + ArtifactName: ${{parameters.ArtifactName}}-${{artifact.name}}-javadevfeed-$(System.JobAttempt) + ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed diff --git a/eng/pipelines/templates/stages/archetype-java-release.yml b/eng/pipelines/templates/stages/archetype-java-release.yml index 2af9bf2588758..70e43f002dd0d 100644 --- a/eng/pipelines/templates/stages/archetype-java-release.yml +++ b/eng/pipelines/templates/stages/archetype-java-release.yml @@ -175,9 +175,10 @@ stages: Target: MavenCentral BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - publish: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed - artifact: ${{parameters.ArtifactName}}-mavencentral - displayName: 'Store gpg signed packages in ${{parameters.ArtifactName}}-mavencentral artifact' + - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + parameters: + ArtifactName: ${{parameters.ArtifactName}}-${{artifact.name}}-mavencentral-$(System.JobAttempt) + ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed # After publishing to Maven, publish to the azure-sdk-for-java feed. The reason for # this is that the azure-sdk-for-java feed will have the package available immediately # whereas Maven can take several hours for the package to become available. @@ -190,9 +191,10 @@ stages: Target: JavaDevFeed BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - publish: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed - artifact: ${{parameters.ArtifactName}}-javadevfeed - displayName: 'Store gpg signed packages in ${{parameters.ArtifactName}}-javadevfeed artifact' + - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + parameters: + ArtifactName: ${{parameters.ArtifactName}}-${{artifact.name}}-javadevfeed-$(System.JobAttempt) + ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed - ${{if ne(artifact.skipPublishDocMs, 'true')}}: - deployment: PublicDocsMs @@ -366,6 +368,7 @@ stages: RepositoryUrl: $(RepositoryUrl) Target: JavaDevFeed JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - publish: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed - artifact: ${{parameters.ArtifactName}}-javadevfeed - displayName: 'Store gpg signed packages in ${{parameters.ArtifactName}}-javadevfeed artifact' + - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + parameters: + ArtifactName: integration-${{parameters.ArtifactName}}-${{artifact.name}}-javadevfeed-$(System.JobAttempt) + ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed