-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
85 lines (76 loc) · 2.51 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
trigger:
branches:
include:
- main
- develop
paths:
exclude:
- ./**/*.md
pool:
vmImage: windows-latest
variables:
currentVersion: '1.0'
betaVersion: '3.0'
${{if eq(variables['Build.SourceBranch'], 'refs/heads/main')}}:
version: $[format('{0}.{1}', variables['currentVersion'], counter(variables['currentVersion'], 0))]
${{if eq(variables['Build.SourceBranch'], 'refs/heads/develop')}}:
version: $[format('{0}.{1}', variables['betaVersion'], counter(variables['betaVersion'], 30))]
name: $(version)
stages:
- stage: build
displayName: 'Build framework'
jobs:
- job: build
displayName: 'Build framework'
steps:
- task: Npm@1
displayName: 'Install dependencies'
inputs:
workingDir: '$(System.DefaultWorkingDirectory)'
verbose: true
- task: Npm@1
displayName: 'Test framework'
inputs:
command: custom
workingDir: '$(System.DefaultWorkingDirectory)'
verbose: false
customCommand: test
- task: Npm@1
displayName: 'Build package'
inputs:
command: custom
workingDir: '$(System.DefaultWorkingDirectory)'
verbose: false
customCommand: 'run build'
- task: DeleteFiles@1
displayName: 'Prepare files'
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)'
Contents: |
node_modules
.vs
.git
- stage: release
displayName: 'Release framework'
dependsOn: build
condition: succeeded()
jobs:
- job: release_beta
displayName: 'Release beta version'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
steps:
- task: ThatBlokeCalledJay.thatblokecalledjay-setjsonproperty.SetJsonProperty.SetJsonProperty@1
displayName: 'Set version name'
inputs:
JsonFile: '$(System.DefaultWorkingDirectory)'
PropertyPath: version
PropertyValue: '$(version)'
- task: Npm@1
displayName: 'Publish new version'
inputs:
command: custom
workingDir: '$(System.DefaultWorkingDirectory)'
verbose: true
customCommand: 'publish --tag beta'
customEndpoint: npm
publishEndpoint: npm