Skip to content

Commit 0fdca5c

Browse files
committed
Move release steps to their own YAML pipeline
1 parent ad59273 commit 0fdca5c

File tree

2 files changed

+100
-89
lines changed

2 files changed

+100
-89
lines changed

azure-pipelines.yml

-89
Original file line numberDiff line numberDiff line change
@@ -213,92 +213,3 @@ stages:
213213
vmImage: macOS-10.15
214214
steps:
215215
- template: azure-pipelines/xplattest-pipeline.yml
216-
217-
- stage: GitHubRelease
218-
displayName: GitHub Release
219-
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
220-
jobs:
221-
- deployment: create
222-
pool:
223-
vmImage: ubuntu-latest
224-
environment: Approval
225-
strategy:
226-
runOnce:
227-
deploy:
228-
steps:
229-
- download: none
230-
- task: GitHubRelease@1
231-
displayName: GitHub release (create)
232-
inputs:
233-
gitHubConnection: GitHub AArnott
234-
repositoryName: $(Build.Repository.Name)
235-
tagSource: userSpecifiedTag
236-
tag: v$(Build.BuildNumber)
237-
title: v$(Build.BuildNumber)
238-
isDraft: true
239-
changeLogCompareToRelease: lastNonDraftRelease
240-
changeLogType: issueBased
241-
changeLogLabels: |
242-
[
243-
{ "label" : "bug", "displayName" : "Fixes", "state" : "closed" },
244-
{ "label" : "enhancement", "displayName": "Enhancements", "state" : "closed" }
245-
]
246-
247-
- stage: nuget_org
248-
displayName: nuget.org
249-
dependsOn: GitHubRelease
250-
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
251-
jobs:
252-
- deployment: push
253-
pool:
254-
vmImage: ubuntu-latest
255-
environment: No-Approval # Approval is already granted in the release stage.
256-
strategy:
257-
runOnce:
258-
deploy:
259-
steps:
260-
- download: current
261-
artifact: deployables
262-
displayName: Download deployables artifact
263-
- task: NuGetToolInstaller@1
264-
displayName: Use NuGet 5.x
265-
inputs:
266-
versionSpec: 5.x
267-
- task: NuGetCommand@2
268-
displayName: NuGet push
269-
inputs:
270-
command: push
271-
packagesToPush: $(Pipeline.Workspace)/deployables/*.nupkg
272-
nuGetFeedType: external
273-
publishFeedCredentials: nuget.org
274-
275-
- stage: npmjs_org
276-
displayName: npmjs.org
277-
dependsOn: GitHubRelease
278-
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
279-
jobs:
280-
- deployment: push
281-
pool:
282-
vmImage: ubuntu-latest
283-
environment: No-Approval # Approval is already granted in the release stage.
284-
strategy:
285-
runOnce:
286-
deploy:
287-
steps:
288-
- download: current
289-
artifact: deployables
290-
displayName: Download deployables artifact
291-
- powershell: |
292-
$tgz = (Get-ChildItem *.tgz)[0].Name
293-
Write-Output ("##vso[task.setvariable variable=TgzPath;]$tgz")
294-
295-
npm install $tgz
296-
workingDirectory: $(Pipeline.Workspace)/deployables
297-
displayName: Prepare to publish TGZ
298-
- task: Npm@1
299-
displayName: npm publish
300-
inputs:
301-
command: publish
302-
workingDir: $(Pipeline.Workspace)/deployables/node_modules/nerdbank-gitversioning
303-
verbose: false
304-
publishEndpoint: npmjs.org

azure-pipelines/release.yml

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
trigger: none # We only want to trigger manually or based on resources
2+
3+
resources:
4+
pipelines:
5+
- pipeline: CI
6+
source: Nerdbank.GitVersioning
7+
trigger:
8+
tags:
9+
- auto-release
10+
11+
stages:
12+
- stage: GitHubRelease
13+
displayName: GitHub Release
14+
jobs:
15+
- deployment: create
16+
pool:
17+
vmImage: ubuntu-latest
18+
environment: No-Approval # Approval is already granted in the release stage.
19+
strategy:
20+
runOnce:
21+
deploy:
22+
steps:
23+
- download: none
24+
- powershell: |
25+
Write-Host "##vso[build.updatebuildnumber]$(resources.pipeline.CI.runName)"
26+
displayName: Set pipeline name
27+
- task: GitHubRelease@1
28+
displayName: GitHub release (create)
29+
inputs:
30+
gitHubConnection: GitHub AArnott
31+
repositoryName: $(Build.Repository.Name)
32+
target: $(resources.pipeline.CI.sourceCommit)
33+
tagSource: userSpecifiedTag
34+
tag: v$(resources.pipeline.CI.runName)
35+
title: v$(resources.pipeline.CI.runName)
36+
isDraft: true
37+
changeLogCompareToRelease: lastNonDraftRelease
38+
changeLogType: issueBased
39+
changeLogLabels: |
40+
[
41+
{ "label" : "bug", "displayName" : "Fixes", "state" : "closed" },
42+
{ "label" : "enhancement", "displayName": "Enhancements", "state" : "closed" }
43+
]
44+
45+
- stage: nuget_org
46+
displayName: nuget.org
47+
dependsOn: GitHubRelease
48+
jobs:
49+
- deployment: push
50+
pool:
51+
vmImage: ubuntu-latest
52+
environment: No-Approval # Approval is already granted in the release stage.
53+
strategy:
54+
runOnce:
55+
deploy:
56+
steps:
57+
- download: CI
58+
artifact: deployables
59+
displayName: Download deployables artifact
60+
- task: NuGetToolInstaller@1
61+
displayName: Use NuGet 5.x
62+
inputs:
63+
versionSpec: 5.x
64+
- task: NuGetCommand@2
65+
displayName: NuGet push
66+
inputs:
67+
command: push
68+
packagesToPush: $(Pipeline.Workspace)/CI/deployables/*.nupkg
69+
nuGetFeedType: external
70+
publishFeedCredentials: nuget.org
71+
72+
- stage: npmjs_org
73+
displayName: npmjs.org
74+
dependsOn: GitHubRelease
75+
jobs:
76+
- deployment: push
77+
pool:
78+
vmImage: ubuntu-latest
79+
environment: No-Approval # Approval is already granted in the release stage.
80+
strategy:
81+
runOnce:
82+
deploy:
83+
steps:
84+
- download: CI
85+
artifact: deployables
86+
displayName: Download deployables artifact
87+
- powershell: |
88+
$tgz = (Get-ChildItem *.tgz)[0].Name
89+
Write-Output ("##vso[task.setvariable variable=TgzPath;]$tgz")
90+
91+
npm install $tgz
92+
workingDirectory: $(Pipeline.Workspace)/CI/deployables
93+
displayName: Prepare to publish TGZ
94+
- task: Npm@1
95+
displayName: npm publish
96+
inputs:
97+
command: publish
98+
workingDir: $(Pipeline.Workspace)/CI/deployables/node_modules/nerdbank-gitversioning
99+
verbose: false
100+
publishEndpoint: npmjs.org

0 commit comments

Comments
 (0)