-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipelines.yml
81 lines (76 loc) · 2.46 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
trigger:
- main
pool:
vmImage: ubuntu-latest
variables:
extensionName: GitHub Advanced Security for Azure DevOps Decorator Tools
extensionId: ghas-for-ado-decorator
publisherId: lupascalin
shareWith: lupascalin
serviceConnection: 'SC-Marketplace-Publishing'
stages :
- stage: get_and_set_version
displayName: Calculate Version
dependsOn: []
jobs:
- job: set_tag_for_version
displayName: Calculate and set git version
steps:
- checkout: self
persistCredentials: true
fetchDepth: 0
- task: gitversion/setup@1
displayName: 'Install GitTools'
inputs:
versionSpec: '5.x'
- task: gitversion/execute@1
displayName: 'Calculate SemVer'
- script: echo Current version is $(GitVersion.SemVer)
displayName: 'Display calculated version'
- task: CmdLine@2
displayName: Init git global config
inputs:
script: |
git config --global user.email $(Build.RequestedForEmail)
git config --global user.name $(Build.RequestedFor)
- task: CmdLine@2
enabled: true
displayName: Create Git tag for current version
inputs:
script: |
git tag -a $(GitVersion.SemVer) -m "Release version $(GitVersion.SemVer)"
git push origin $(GitVersion.SemVer)
- stage: publish_dev_extension
displayName: 'Build and Publish ADO extension (Dev)'
dependsOn: [get_and_set_version]
jobs:
- deployment: deploy_dev_extension
environment: 'DEV-ghas-for-ado-decorator-extension'
strategy:
runOnce:
deploy:
steps:
- template: template-publish-ado-extension.yml
parameters:
serviceConnection: '$(serviceConnection)'
publisherId: '$(publisherId)'
extensionId: '$(extensionId)-dev'
extensionName: ' (DEV) $(extensionName)'
shareWith: '$(shareWith)'
- stage: publish_prod_extension
displayName: 'Build and Publish ADO extension (Prod)'
dependsOn: [publish_dev_extension]
jobs:
- deployment: deploy_prod_extension
environment: 'PROD-ghas-for-ado-decorator-extension'
strategy:
runOnce:
deploy:
steps:
- template: template-publish-ado-extension.yml
parameters:
serviceConnection: '$(serviceConnection)'
publisherId: '$(publisherId)'
extensionId: '$(extensionId)'
extensionName: '$(extensionName)'
shareWith: '$(shareWith)'