Skip to content

Commit

Permalink
Update to BOM publishing (Azure#12657)
Browse files Browse the repository at this point in the history
* Update to BOM publishing

* Missing beginning plugins tag

* Update test bom version to the next unreleased version
  • Loading branch information
JimSuplizio authored Jun 30, 2020
1 parent 1ea2b1b commit 2336b05
Show file tree
Hide file tree
Showing 12 changed files with 365 additions and 52 deletions.
1 change: 1 addition & 0 deletions eng/.docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ known_content_issues:
- ['sdk/authorization/microsoft-azure-authentication-msi-token-provider/README.md', '#3113']
- ['sdk/batch/microsoft-azure-batch/README.md', '#3113']
- ['sdk/boms/azure-sdk-bom/README.md', '#3113']
- ['sdk/boms/azure-sdk-template-bom/README.md', '#3113']
- ['sdk/core/README.md', '#3113']
- ['sdk/core/azure-core-experimental/README.md', '#3113']
- ['sdk/cognitiveservices/ms-azure-cs-textanalytics/README.md', '#3113']
Expand Down
119 changes: 119 additions & 0 deletions eng/pipelines/templates/stages/archetype-java-release-pom-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
parameters:
Artifacts: []
ArtifactName: 'not-specified'
TargetDocRepoOwner: ''
TargetDocRepoName: ''
EnableIntegrationStage: true

stages:
# The signing stage is responsible for submitting binaries to ESRP for our official signing
# where appropriate and also meeting any other signing requirements for particular artifacts,
# in this case we do GPG signing in order to publish to Maven Central. At the moment signing
# is protected by an approval check but this may be removed in the future.
- stage: Signing
dependsOn: ${{parameters.DependsOn}}
jobs:
- deployment: SignPackage
environment: esrp
timeoutInMinutes: 20
variables:
- template: ../variables/globals.yml
pool:
vmImage: ubuntu-18.04
strategy:
runOnce:
deploy:
steps:
- checkout: none

- download: current
artifact: ${{parameters.ArtifactName}}
timeoutInMinutes: 5

- template: tools/java-esrp-signing/java-esrp-signing.yml@azure-sdk-build-tools
parameters:
Artifacts: ${{parameters.Artifacts}}
ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}

- publish: $(Pipeline.Workspace)/${{parameters.ArtifactName}}
artifact: ${{parameters.ArtifactName}}-signed
displayName: 'Store signed packages in ${{parameters.ArtifactName}}-signed artifact'
timeoutInMinutes: 5

# We generate two interdepdent stages for each artifact listed in the ci.yml file, creates the release
# in GitHub. The Release stage publishes to Maven Central. Both stages require approval since they
# effectively burn the version number. For testing of packages prior to burning the version number -
# the Validation step below publishes a package to a "burner" feed which is cleaned up after the
# pipeline completes.
- ${{if and(eq(variables['Build.Reason'], 'Manual'), eq(variables['System.TeamProject'], 'internal'))}}:
- ${{ each artifact in parameters.Artifacts }}:
- stage: Release_${{artifact.safeName}}
displayName: 'Release: ${{artifact.name}}'
dependsOn: Signing
condition: and(succeeded(), ne(variables['SetDevVersion'], 'true'), ne(variables['Skip.Release'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-java-pr'))
jobs:
- deployment: TagRepository
displayName: "Create release tag"
condition: ne(variables['Skip.TagRepository'], 'true')
environment: github
timeoutInMinutes: 5
variables:
- template: ../variables/globals.yml
pool:
vmImage: vs2017-win2016
strategy:
runOnce:
deploy:
steps:
- checkout: self
- template: /eng/pipelines/templates/steps/stage-artifacts.yml
parameters:
SourceFolder: ${{parameters.ArtifactName}}-signed
TargetFolder: ${{artifact.safeName}}
PackageName: ${{artifact.name}}
- template: /eng/common/pipelines/templates/steps/create-tags-and-git-release.yml
parameters:
ArtifactLocation: $(Pipeline.Workspace)/${{artifact.safeName}}
PackageRepository: Maven
ReleaseSha: $(Build.SourceVersion)
RepoId: Azure/azure-sdk-for-java

- ${{if ne(artifact.options.skipPublishPackage, 'true')}}:
- deployment: PublishPackage
displayName: "Publish to Maven Central"
condition: and(succeeded(), ne(variables['Skip.PublishPackage'], 'true'))
environment: maven
dependsOn: TagRepository
variables:
- template: ../variables/globals.yml
pool:
vmImage: vs2017-win2016
strategy:
runOnce:
deploy:
steps:
- checkout: self
path: azure-sdk-for-java
- checkout: azure-sdk-build-tools
path: azure-sdk-build-tools
- template: tools/gpg/gpg.yml@azure-sdk-build-tools
- template: /eng/pipelines/templates/steps/java-publishing.yml
parameters:
ArtifactID: ${{artifact.name}}
GroupID: ${{artifact.groupId}}
ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed
Target: MavenCentral
BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools
JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java
# 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.
- template: /eng/pipelines/templates/steps/java-publishing.yml
parameters:
ArtifactID: ${{artifact.name}}
GroupID: ${{artifact.groupId}}
ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed
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
2 changes: 1 addition & 1 deletion eng/pipelines/templates/stages/archetype-sdk-pom-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ stages:

# The Prerelease and Release stages are conditioned on whether we are building a pull request and the branch.
- ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'))}}:
- template: archetype-java-release.yml
- template: archetype-java-release-pom-only.yml
parameters:
DependsOn: Build
ServiceDirectory: ${{parameters.ServiceDirectory}}
Expand Down
90 changes: 59 additions & 31 deletions eng/pipelines/templates/steps/java-publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,69 @@ parameters:

steps:
- ${{if eq(parameters.Target, 'Burner')}}:
- pwsh: >
${{parameters.JavaRepoRoot}}/eng/scripts/Publish-MavenPackages.ps1 -ArtifactDirectory ${{parameters.ArtifactDirectory}}
-GroupIDFilter ${{parameters.GroupID}} -ArtifactIDFilter ${{parameters.ArtifactID}}
-RepositoryUrl https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-$(Build.BuildID)/maven/v1
-RepositoryUsername nobody -RepositoryPassword $(System.AccessToken)
-GPGExecutablePath ${{parameters.BuildToolsPath}}/tools/gpg/bin/gpg.exe -InformationAction Continue
workingDirectory: $(Agent.BuildDirectory)
- task: PowerShell@2
displayName: 'Publish to Burner Feed'
inputs:
pwsh: true
workingDirectory: $(Agent.BuildDirectory)
filePath: ${{ parameters.JavaRepoRoot }}/eng/scripts/Publish-MavenPackages.ps1
arguments: >
-ArtifactDirectory ${{ parameters.ArtifactDirector }}
-GroupIDFilter ${{ parameters.GroupID }}
-ArtifactIDFilter ${{ parameters.ArtifactID }}
-RepositoryUrl https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-$(Build.BuildID)/maven/v1
-RepositoryUsername nobody
-RepositoryPassword $(System.AccessToken)
-GPGExecutablePath ${{ parameters.BuildToolsPath }}/tools/gpg/bin/gpg.exe
-InformationAction Continue
- ${{if eq(parameters.Target, 'JavaDevFeed')}}:
- pwsh: >
${{parameters.JavaRepoRoot}}/eng/scripts/Publish-MavenPackages.ps1 -ArtifactDirectory ${{parameters.ArtifactDirectory}}
-GroupIDFilter ${{parameters.GroupID}} -ArtifactIDFilter ${{parameters.ArtifactID}}
-RepositoryUrl ${{parameters.RepositoryUrl}}
-RepositoryUsername nobody -RepositoryPassword $(System.AccessToken)
-GPGExecutablePath ${{parameters.BuildToolsPath}}/tools/gpg/bin/gpg.exe -InformationAction Continue
workingDirectory: $(Agent.BuildDirectory)
- task: PowerShell@2
displayName: 'Publish to Java Dev Feed'
inputs:
pwsh: true
workingDirectory: $(Agent.BuildDirectory)
filePath: ${{ parameters.JavaRepoRoot }}/eng/scripts/Publish-MavenPackages.ps1
arguments: >
-ArtifactDirectory ${{ parameters.ArtifactDirectory }}
-GroupIDFilter ${{ parameters.GroupID }}
-ArtifactIDFilter ${{ parameters.ArtifactID }}
-RepositoryUrl ${{ parameters.RepositoryUrl }}
-RepositoryUsername nobody
-RepositoryPassword $(System.AccessToken)
-GPGExecutablePath ${{ parameters.BuildToolsPath }}/tools/gpg/bin/gpg.exe
-InformationAction Continue
- ${{if eq(parameters.Target, 'AndroidDevFeed')}}:
- pwsh: >
${{parameters.JavaRepoRoot}}/eng/scripts/Publish-MavenPackages.ps1 -ArtifactDirectory ${{parameters.ArtifactDirectory}}
-GroupIDFilter ${{parameters.GroupID}} -ArtifactIDFilter ${{parameters.ArtifactID}}
-RepositoryUrl https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-android/maven/v1
-RepositoryUsername nobody -RepositoryPassword $(System.AccessToken)
-GPGExecutablePath ${{parameters.BuildToolsPath}}/tools/gpg/bin/gpg.exe -InformationAction Continue
workingDirectory: $(Agent.BuildDirectory)
- task: PowerShell@2
displayName: 'Publish to Andriod Public Dev Feed'
inputs:
pwsh: true
workingDirectory: $(Agent.BuildDirectory)
filePath: ${{ parameters.JavaRepoRoot }}/eng/scripts/Publish-MavenPackages.ps1
arguments: >
-ArtifactDirectory ${{ parameters.ArtifactDirectory }}
-GroupIDFilter ${{ parameters.GroupID }}
-ArtifactIDFilter ${{ parameters.ArtifactID }}
-RepositoryUrl https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-android/maven/v1
-RepositoryUsername nobody
-RepositoryPassword $(System.AccessToken)
-GPGExecutablePath ${{ parameters.BuildToolsPath }}/tools/gpg/bin/gpg.exe
-InformationAction Continue
- ${{if eq(parameters.Target, 'MavenCentral')}}:
- pwsh: >
${{parameters.JavaRepoRoot}}/eng/scripts/Publish-MavenPackages.ps1 -ArtifactDirectory ${{parameters.ArtifactDirectory}}
-GroupIDFilter ${{parameters.GroupID}} -ArtifactIDFilter ${{parameters.ArtifactID}}
-RepositoryUrl https://oss.sonatype.org/service/local/staging/deploy/maven2/
-RepositoryUsername azuresdk -RepositoryPassword $(azuresdk-sonatype-password)
-GPGExecutablePath ${{parameters.BuildToolsPath}}/tools/gpg/bin/gpg.exe -InformationAction Continue
workingDirectory: $(Agent.BuildDirectory)
displayName: 'Publish to Maven Central'
- task: PowerShell@2
displayName: 'Publish to Maven Central'
inputs:
pwsh: true
workingDirectory: $(Agent.BuildDirectory)
filePath: ${{ parameters.JavaRepoRoot }}/eng/scripts/Publish-MavenPackages.ps1
arguments: >
-ArtifactDirectory ${{ parameters.ArtifactDirectory }}
-GroupIDFilter ${{ parameters.GroupID }}
-ArtifactIDFilter ${{ parameters.ArtifactID }}
-RepositoryUrl https://oss.sonatype.org/service/local/staging/deploy/maven2/
-RepositoryUsername azuresdk
-RepositoryPassword $(azuresdk-sonatype-password)
-GPGExecutablePath ${{ parameters.BuildToolsPath }}/tools/gpg/bin/gpg.exe
-InformationAction Continue
Loading

0 comments on commit 2336b05

Please sign in to comment.