Skip to content

Commit

Permalink
Migrate Partner Release to 1ES supporting yml (#29852)
Browse files Browse the repository at this point in the history
  • Loading branch information
scbedd authored May 30, 2024
1 parent d952e2b commit 6d9d599
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 25 deletions.
62 changes: 62 additions & 0 deletions eng/pipelines/templates/stages/partner-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
trigger: none
pr: none

parameters:
- name: BlobPath
displayName: 'Container relative blob path'
type: string
default: '<team>/js/<version>'
- name: Tag
displayName: 'The tag under which the package will be published.'
type: string
default: 'latest'

extends:
template: /eng/pipelines/templates/stages/1es-redirect.yml
parameters:
stages:
- stage:
displayName: 'Partner Release'
variables:
- name: Artifacts
value: $(Pipeline.Workspace)/artifacts
- template: /eng/pipelines/templates/variables/image.yml

jobs:
- job:
displayName: 'Download and publish artifacts'
pool:
name: $(WINDOWSPOOL)
image: $(WINDOWSVMIMAGE)
os: windows

steps:
- task: AzurePowerShell@5
displayName: 'Copy from azuresdkpartnerdrops'
condition: and(succeeded(), ne(variables['SkipCopyFromPartnerDrops'], 'true'))
inputs:
azureSubscription: 'azuresdkpartnerdrops - Storage Partner Drops'
ScriptType: 'InlineScript'
azurePowerShellVersion: LatestVersion
pwsh: true
Inline: |
azcopy copy 'https://azuresdkpartnerdrops.blob.core.windows.net/drops/${{ parameters.BlobPath }}/*' '$(Artifacts)' --recursive=true
echo "Copied files:"
dir '$(Artifacts)' -r | % { $_.FullName }
env:
AZCOPY_AUTO_LOGIN_TYPE: 'PSCRED'

- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
parameters:
ArtifactName: 'artifacts-for-release'
ArtifactPath: $(Artifacts)

- template: /eng/pipelines/templates/steps/npm-release-task.yml
parameters:
ArtifactName: Partner Drop
Artifact:
name: Partner Drop
path: $(Artifacts)
Registry: "https://registry.npmjs.org/"
PathToArtifacts: $(Artifacts)
Tag: "${{ parameters.Tag }}"
53 changes: 28 additions & 25 deletions eng/pipelines/templates/steps/npm-release-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,27 @@ parameters:

steps:
- template: /eng/common/pipelines/templates/steps/set-default-branch.yml

- ${{ if eq(parameters.Registry, 'https://registry.npmjs.org/') }}:
- task: EsrpRelease@7
inputs:
displayName: 'Publish ${{parameters.Artifact.name}} to ESRP'
ConnectedServiceName: 'Azure SDK Engineering System'
ClientId: '5f81938c-2544-4f1f-9251-dd9de5b8a81b'
KeyVaultName: 'AzureSDKEngKeyVault'
AuthCertName: 'azure-sdk-esrp-release-auth-certificate'
SignCertName: 'azure-sdk-esrp-release-sign-certificate'
Intent: 'PackageDistribution'
ContentType: 'npm'
FolderLocation: ${{parameters.PathToArtifacts}}
Owners: ${{ coalesce(variables['Build.RequestedForEmail'], '[email protected]') }}
Approvers: '[email protected]'
ServiceEndpointUrl: 'https://api.esrp.microsoft.com'
MainPublisher: 'ESRPRELPACMANTEST'
DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47'
productstate: ${{parameters.Tag}}
- task: EsrpRelease@7
inputs:
displayName: 'Publish ${{parameters.Artifact.name}} to ESRP'
ConnectedServiceName: 'Azure SDK Engineering System'
ClientId: '5f81938c-2544-4f1f-9251-dd9de5b8a81b'
KeyVaultName: 'AzureSDKEngKeyVault'
AuthCertName: 'azure-sdk-esrp-release-auth-certificate'
SignCertName: 'azure-sdk-esrp-release-sign-certificate'
Intent: 'PackageDistribution'
ContentType: 'npm'
FolderLocation: ${{parameters.PathToArtifacts}}
Owners: ${{ coalesce(variables['Build.RequestedForEmail'], '[email protected]') }}
Approvers: '[email protected]'
ServiceEndpointUrl: 'https://api.esrp.microsoft.com'
MainPublisher: 'ESRPRELPACMANTEST'
DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47'
productstate: ${{parameters.Tag}}

- ${{ if ne(parameters.AdditionalTag, '') }}:
- task: PowerShell@2
displayName: Add Additional Tag
inputs:
Expand All @@ -36,11 +39,11 @@ steps:
condition: succeeded()

- ${{ else }}:
- task: PowerShell@2
displayName: Publish to Dev Feed
inputs:
targetType: filePath
filePath: eng/tools/publish-to-npm.ps1
arguments: -pathToArtifacts ${{parameters.PathToArtifacts}} -accessLevel "public" -tag "${{parameters.Tag}}" -additionalTag "${{parameters.AdditionalTag}}" -registry ${{parameters.Registry}} -npmToken $(azure-sdk-npm-token)
pwsh: true
condition: succeeded()
- task: PowerShell@2
displayName: Publish to Dev Feed
inputs:
targetType: filePath
filePath: eng/tools/publish-to-npm.ps1
arguments: -pathToArtifacts ${{parameters.PathToArtifacts}} -accessLevel "public" -tag "${{parameters.Tag}}" -additionalTag "${{parameters.AdditionalTag}}" -registry ${{parameters.Registry}} -npmToken $(azure-sdk-npm-token)
pwsh: true
condition: succeeded()

0 comments on commit 6d9d599

Please sign in to comment.