forked from surveyjs/custom-widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devops-integration.yml
99 lines (85 loc) · 2.86 KB
/
devops-integration.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
# SurveyJS Widgets integration builds
trigger:
batch: true
branches:
include:
- master
tags:
exclude:
- v*.*.*
pool:
vmImage: "Ubuntu-20.04"
steps:
- task: NodeTool@0
inputs:
versionSpec: "14.x"
displayName: "Install Node.js"
- task: CopyFiles@2
inputs:
SourceFolder: "$(Build.SourcesDirectory)/"
Contents: "package.json"
TargetFolder: "$(Build.SourcesDirectory)/Temp/"
OverWrite: true
displayName: "Copy package.json for cache key"
- task: Cache@2
inputs:
key: 'npm-cache-custom-widgets | $(Build.SourcesDirectory)/Temp/package.json'
path: $(Build.SourcesDirectory)/node_modules
cacheHitVar: NPM_CACHE_RESTORED
displayName: Cache NPM
- task: Npm@1
displayName: 'NPM install'
inputs:
command: install
verbose: false
condition: ne(variables.NPM_CACHE_RESTORED, 'true')
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'specific'
project: 'af2804d2-859a-4705-9ef5-cdf46d1d5d4f'
pipeline: '56'
specificBuildWithTriggering: true
buildVersionToDownload: 'latest'
downloadType: 'single'
artifactName: 'SurveyJSLibraryBuild'
downloadPath: '$(System.ArtifactsDirectory)'
- task: CopyFiles@2
inputs:
SourceFolder: "$(System.ArtifactsDirectory)/SurveyJSLibraryBuild/packages/survey-core"
Contents: "**"
TargetFolder: "$(Build.Repository.LocalPath)/node_modules/survey-core"
OverWrite: true
# npm run release with version
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/SurveyJSLibraryBuild/'
Contents: 'version.txt'
TargetFolder: '$(Build.SourcesDirectory)/'
OverWrite: true
displayName: 'Copy Build Artifact - SurveyJSVersion File'
- powershell: |
$version = Get-Content $(Build.SourcesDirectory)/version.txt
Write-Host "##vso[task.setvariable variable=SurveyJSVersion;]$version"
displayName: 'setup SurveyJSVersion variable from SurveyJSVersionFile'
- powershell: |
$env:GIT_REDIRECT_STDERR = '2>&1'
git config --global user.email "kurmanov.work@gmail.com"
git config --global user.name "dmitrykurmanov"
npm run release -- --release-as $(SurveyJSVersion)
displayName: 'npm run release specific version'
#####################################################
- script: |
npm run build
displayName: "build"
- script: |
npm run testcafe:ci
displayName: "run functional tests"
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.Repository.LocalPath)/package'
targetFolder: $(Build.ArtifactStagingDirectory)/SurveyJSWidgetsBuild/packages/survey-widgets
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/SurveyJSWidgetsBuild/'
ArtifactName: 'SurveyJSWidgetsBuild'
publishLocation: 'Container'