forked from stoplightio/spectral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
70 lines (60 loc) · 1.63 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
trigger:
tags:
include:
- v*
branches:
include:
- master
- develop
pr:
branches:
include:
- master
- develop
jobs:
- job: test
displayName: Test
pool:
vmImage: vs2017-win2016
steps:
- task: NodeTool@0
inputs:
versionSpec: '12.x'
displayName: Install Node.js
- script: yarn
displayName: Install deps
- script: yarn build
displayName: Build the code in JavaScript
- script: yarn lint
displayName: Lint the code
- script: yarn test.karma
displayName: Run the browser tests
- script: yarn test
displayName: Run the NodeJS tests
- script: npx pkg --output ./binaries/spectral-cli ./
displayName: Create binary
- publish: ./binaries/
artifact: spectral-cli-win.exe
- job: publish
dependsOn: test
displayName: Publish binary
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
pool:
vmImage: vs2017-win2016
steps:
- powershell: |
$ver = $env:BUILD_SOURCEBRANCH.remove(0, 10)
Write-Host "##vso[task.setvariable variable=Tag;isOutput=true]$ver"
displayName: 'Update version to Tag'
name: setTag
- task: DownloadPipelineArtifact@2
inputs:
path: $(Build.ArtifactStagingDirectory)
- task: GitHubRelease@0
inputs:
gitHubConnection: spartacusroboticus
assets: '$(Build.ArtifactStagingDirectory)/**/*'
action: edit
assetUploadMode: replace
addChangeLog: false
tag: $(setTag.Tag)