-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathazure-pipelines.yml
81 lines (70 loc) · 1.99 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
schedules:
- cron: "0 1 * * *"
displayName: Nightly
branches:
include:
- master
always: true
trigger:
batch: true
branches:
include:
- master
pr:
branches:
include:
- '*'
paths:
exclude:
- '.github/*'
variables:
buildNumber: $[counter(variables['packageVersion'], 1)]
packageVersion: '1.2.0'
packageVersionDev: $(packageVersion).$(buildNumber)
stages:
- stage: BuildandTest
displayName: 'Build test and package extension'
jobs:
- job: Build
pool:
vmImage: 'ubuntu-latest'
steps:
- script: echo "##vso[build.updatebuildnumber]$(packageVersionDev)"
displayName: 'Set build number'
- task: replacetokens@6
inputs:
targetFiles: '**/azure-devops-extension*.json'
- task: NodeTool@0
inputs:
versionSpec: '20.x'
displayName: 'Install Node.js LTS'
- script: |
npm install
npx lerna bootstrap
npx lerna run compile
displayName: 'Build'
- script: ''
displayName: 'Test'
- script: |
npm run package -- --output-path $(Build.ArtifactStagingDirectory)/prod
displayName: 'create production extension'
- script: |
npm run package:dev -- --output-path $(Build.ArtifactStagingDirectory)/dev
displayName: 'create development extension'
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'mutation-report-publisher'
- template: 'pipeline-templates/deployment-stage.yml'
parameters:
name: 'dev'
environment: 'Visual studio marketplace development'
vsixFilePattern: 'mutation-report-publisher/dev/*.vsix'
isTestPackage: 'true'
- template: 'pipeline-templates/deployment-stage.yml'
parameters:
name: 'prod'
environment: 'Visual studio marketplace production'
vsixFilePattern: 'mutation-report-publisher/prod/*.vsix'
isTestPackage: 'false'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')