-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
azure-pipelines.yml
44 lines (38 loc) · 1.17 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
$version = if ((Get-Content -Raw src/azdo-pr-dashboard.user.js) -match "@version\s+(?<Version>.*)") { $Matches.Version } else { throw "Version not found." }
Write-Host "Version = $version"
Write-Host "##vso[task.setvariable variable=version]$version"
displayName: 'Parse version from userscript'
- task: NodeTool@0
inputs:
versionSpec: '16.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build
displayName: 'npm install and build'
- task: CopyFiles@2
inputs:
Contents: 'src/**/*'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
condition: succeeded()
- task: GitHubRelease@0
inputs:
gitHubConnection: ghalejandro5042
repositoryName: '$(Build.Repository.Name)'
target: '$(Build.SourceVersion)'
action: 'create'
tagSource: 'manual'
tag: 'v$(Version)'
addChangeLog: true
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
continueOnError: true