Skip to content

Commit 8058c85

Browse files
authored
Moving release into build yml (#696)
* 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
1 parent 9e4296a commit 8058c85

4 files changed

Lines changed: 74 additions & 2 deletions

File tree

azure-pipelines/1es-redirect.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ extends:
3434
image: azsdk-pool-mms-win-2022-1espt
3535
os: windows
3636
sourceRepositoriesToScan:
37+
include:
38+
- repository: self
39+
submodule: false
3740
exclude:
3841
- repository: azure-sdk-build-tools
42+
runInSingleJob: true
3943
eslint:
4044
enabled: false
4145
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'

azure-pipelines/prod-release-pipelines.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extends:
22
template: /azure-pipelines/1es-redirect.yml
33
parameters:
44
stages:
5-
- stage: Prod_Release
5+
- stage: Build
66
displayName: Prod Release
77

88
variables:
@@ -35,3 +35,8 @@ extends:
3535
parameters:
3636
ArtifactName: drop
3737
ArtifactPath: $(Build.SourcesDirectory)/dist
38+
39+
- ${{ if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'internal'))}}:
40+
- template: /azure-pipelines/release-stage.yml
41+
parameters:
42+
Version: latest

azure-pipelines/release-stage.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
parameters:
2+
- name: Version
3+
type: string
4+
default: 'staging'
5+
values:
6+
- 'beta'
7+
- 'latest'
8+
9+
stages:
10+
- stage: Release
11+
displayName: Release ${{ parameters.Version }}
12+
dependsOn: Build
13+
14+
jobs:
15+
- deployment: Publish
16+
environment: 'package-publish'
17+
pool:
18+
name: azsdk-pool-mms-ubuntu-2004-general
19+
image: azsdk-pool-mms-ubuntu-2004-1espt
20+
os: linux
21+
22+
strategy:
23+
runOnce:
24+
deploy:
25+
steps:
26+
- checkout: self
27+
submodules: false
28+
29+
- download: current
30+
artifact: drop
31+
timeoutInMinutes: 5
32+
33+
- pwsh: |
34+
Write-Host "Will deploy with tag of ${{ parameters.Version }}"
35+
Get-ChildItem "$(Pipeline.Workspace)/drop" -Recurse -Force `
36+
| Where-Object { $_.Name -like "*.tgz" } `
37+
| Copy-Item -Destination "$(Build.ArtifactStagingDirectory)"
38+
39+
Get-ChildItem "$(Build.ArtifactStagingDirectory)" -Recurse -Force | % { Write-Host $_.FullName }
40+
displayName: Move artifact to $(Build.ArtifactStagingDirectory)
41+
42+
- task: EsrpRelease@7
43+
inputs:
44+
displayName: 'Publish to ESRP'
45+
ConnectedServiceName: 'Azure SDK Engineering System'
46+
ClientId: '5f81938c-2544-4f1f-9251-dd9de5b8a81b'
47+
KeyVaultName: 'AzureSDKEngKeyVault'
48+
AuthCertName: 'azure-sdk-esrp-release-auth-certificate'
49+
SignCertName: 'azure-sdk-esrp-release-sign-certificate'
50+
Intent: 'PackageDistribution'
51+
ContentType: 'npm'
52+
FolderLocation: $(Build.ArtifactStagingDirectory)
53+
Owners: ${{ coalesce(variables['Build.RequestedForEmail'], 'azuresdk@microsoft.com') }}
54+
Approvers: 'azuresdk@microsoft.com'
55+
ServiceEndpointUrl: 'https://api.esrp.microsoft.com'
56+
MainPublisher: 'ESRPRELPACMANTEST'
57+
DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47'
58+
productstate: ${{ parameters.Version }}

azure-pipelines/staging-release-pipelines.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extends:
22
template: /azure-pipelines/1es-redirect.yml
33
parameters:
44
stages:
5-
- stage: Staging_Release
5+
- stage: Build
66
displayName: Staging Release
77

88
variables:
@@ -39,3 +39,8 @@ extends:
3939
parameters:
4040
ArtifactName: drop
4141
ArtifactPath: $(Build.SourcesDirectory)/dist
42+
43+
- ${{ if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'internal'))}}:
44+
- template: /azure-pipelines/release-stage.yml
45+
parameters:
46+
Version: beta

0 commit comments

Comments
 (0)