Skip to content

Commit

Permalink
Moving release into build yml (#696)
Browse files Browse the repository at this point in the history
* added a release stage to the pipeline which produces the tooling packages
* said release stage only appears on manually queued internal builds, and attempts to publish all packages within the repo
  • Loading branch information
scbedd authored Jun 3, 2024
1 parent 9e4296a commit 8058c85
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 2 deletions.
4 changes: 4 additions & 0 deletions azure-pipelines/1es-redirect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ extends:
image: azsdk-pool-mms-win-2022-1espt
os: windows
sourceRepositoriesToScan:
include:
- repository: self
submodule: false
exclude:
- repository: azure-sdk-build-tools
runInSingleJob: true
eslint:
enabled: false
justificationForDisabling: 'ESLint injected task has failures because it uses an old version of mkdirp. We should not fail for tools not controlled by the repo. See: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3499746'
Expand Down
7 changes: 6 additions & 1 deletion azure-pipelines/prod-release-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends:
template: /azure-pipelines/1es-redirect.yml
parameters:
stages:
- stage: Prod_Release
- stage: Build
displayName: Prod Release

variables:
Expand Down Expand Up @@ -35,3 +35,8 @@ extends:
parameters:
ArtifactName: drop
ArtifactPath: $(Build.SourcesDirectory)/dist

- ${{ if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'internal'))}}:
- template: /azure-pipelines/release-stage.yml
parameters:
Version: latest
58 changes: 58 additions & 0 deletions azure-pipelines/release-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
parameters:
- name: Version
type: string
default: 'staging'
values:
- 'beta'
- 'latest'

stages:
- stage: Release
displayName: Release ${{ parameters.Version }}
dependsOn: Build

jobs:
- deployment: Publish
environment: 'package-publish'
pool:
name: azsdk-pool-mms-ubuntu-2004-general
image: azsdk-pool-mms-ubuntu-2004-1espt
os: linux

strategy:
runOnce:
deploy:
steps:
- checkout: self
submodules: false

- download: current
artifact: drop
timeoutInMinutes: 5

- pwsh: |
Write-Host "Will deploy with tag of ${{ parameters.Version }}"
Get-ChildItem "$(Pipeline.Workspace)/drop" -Recurse -Force `
| Where-Object { $_.Name -like "*.tgz" } `
| Copy-Item -Destination "$(Build.ArtifactStagingDirectory)"
Get-ChildItem "$(Build.ArtifactStagingDirectory)" -Recurse -Force | % { Write-Host $_.FullName }
displayName: Move artifact to $(Build.ArtifactStagingDirectory)
- task: EsrpRelease@7
inputs:
displayName: 'Publish 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: $(Build.ArtifactStagingDirectory)
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.Version }}
7 changes: 6 additions & 1 deletion azure-pipelines/staging-release-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends:
template: /azure-pipelines/1es-redirect.yml
parameters:
stages:
- stage: Staging_Release
- stage: Build
displayName: Staging Release

variables:
Expand Down Expand Up @@ -39,3 +39,8 @@ extends:
parameters:
ArtifactName: drop
ArtifactPath: $(Build.SourcesDirectory)/dist

- ${{ if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'internal'))}}:
- template: /azure-pipelines/release-stage.yml
parameters:
Version: beta

0 comments on commit 8058c85

Please sign in to comment.