This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipelines.yml
119 lines (111 loc) · 3.25 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
parameters:
- name: taskVersion
displayName: 'Task Version'
type: string
default: $(Task.Extension.Version)
- name: compileMode
displayName: 'Compile Mode'
type: string
default: dev
values:
- dev
- prod
trigger:
branches:
include:
- main
paths:
exclude:
- .github/*
- .azext/*
- .vscode/*
- .ci/*
- docs/*
pr: none
pool:
vmImage: ubuntu-latest
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
marketplaceServiceConnection: 'marketplace-joachim-dalen'
stages:
- stage: 'run_tests'
displayName: Test & Build
jobs:
- job:
steps:
- template: .ci/install-and-build.template.yml
parameters:
compileMode: dev
- template: .ci/run-tests.template.yml
- stage: package_dev
displayName: '[DEV] Package'
dependsOn: 'run_tests'
condition: and(succeeded(), eq(variables.isMain, false))
variables:
- group: 'mp-env-transform-dev'
jobs:
- template: .ci/build-docs.template.yml
parameters:
extensionEnv: dev
generateVersionChangelog: false
taskVersion: ${{ parameters.taskVersion }}
- template: .ci/build-extension-artifact.template.yml
parameters:
compileMode: ${{ parameters.compileMode }}
extensionEnv: dev
taskVersion: ${{ parameters.taskVersion }}
- stage: publish_dev
displayName: '[DEV] Publish'
dependsOn: 'package_dev'
condition: and(succeeded(), eq(variables.isMain, false))
variables:
- group: 'mp-env-transform-dev'
jobs:
- template: .ci/publish-extension.template.yml
parameters:
pipelineEnv: env-transform-dev-env
extensionVisibility: private
- stage: verify_changelog
dependsOn: 'run_tests'
condition: and(succeeded(), eq(variables.isMain, true))
displayName: 'Check changelog'
jobs:
- job:
steps:
- task: GitGuardChanges@0
displayName: '[PROD] Verify changelog'
inputs:
sourceCommitHash: 'tag:v*'
matchPattern: '.azext/changelog.json'
targetCommitHash: 'HEAD'
matchStrategy: 'single'
changed: true
breakOnFailure: true
- stage: package_prod
displayName: '[PROD] Package'
dependsOn: 'verify_changelog'
condition: and(succeeded(), eq(variables.isMain, true))
variables:
- group: 'mp-env-transform-prod'
jobs:
- template: .ci/build-docs.template.yml
parameters:
extensionEnv: prod
taskVersion: ${{ parameters.taskVersion }}
- template: .ci/build-extension-artifact.template.yml
parameters:
compileMode: prod
extensionEnv: prod
taskVersion: ${{ parameters.taskVersion }}
- stage: publish_prod
displayName: '[PROD] Publish'
dependsOn: 'package_prod'
condition: and(succeeded(), eq(variables.isMain, true))
variables:
- group: 'mp-env-transform-prod'
jobs:
- template: .ci/publish-extension.template.yml
parameters:
pipelineEnv: env-transform-prod-env
extensionVisibility: public_preview