-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yaml
72 lines (71 loc) · 2.54 KB
/
azure-pipelines.yaml
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
trigger:
batch: true
branches:
include:
- main
pr:
- main
variables:
MajorVersion : 0
MinorVersion : 0
PatchVersion : $[counter(format('nexus-extension-{0}.{1}.{2}',variables['Build.SourceBranchName'],variables['MajorVersion'],variables['MinorVersion']), 90)]
isPR : $[startsWith(variables['Build.SourceBranch'],'refs/pull/')]
isMain : $[startsWith(variables['Build.SourceBranch'],'refs/heads/main')]
stages:
- stage : build_package
displayName: Build & Package Extension
jobs:
- job : build_package
displayName: Build & Package Extension
pool:
vmImage: 'windows-latest'
steps:
- checkout: self
persistCredentials: true
clean: true
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: npm install -g tfx-cli
displayName: 'Install Node CLI for Azure DevOps'
- script: npm install
displayName: 'Install Dependencies'
- script: npm run lint
displayName: 'Run ESLint'
condition: eq(variables.isPR, true)
- script: |
npm run build
condition: eq(variables.isPR, true)
displayName: 'Build Extension'
- script: |
npm run package -- --override {\"version\": \"$(MajorVersion).$(MinorVersion).$(PatchVersion)\"}
displayName: 'Build & Package Extension'
condition: eq(variables.isMain, true)
- task: PowerShell@2
displayName: 'Tag Git Commit'
condition: eq(variables.isMain, true)
inputs:
targetType: 'inline'
script: |
git tag "v$(MajorVersion).$(MinorVersion).$(PatchVersion)"
- task: PowerShell@2
displayName: 'Push Git Tags'
condition: eq(variables.isMain, true)
inputs:
targetType: 'inline'
script: |
git push --tags
- task: GitHubRelease@1
displayName: 'Publish Extension as Release'
condition: eq(variables.isMain, true)
inputs:
gitHubConnection: 'github.com_keyoke'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'gitTag'
tagPattern: 'v$(MajorVersion).$(MinorVersion).$(PatchVersion)'
assets: '$(System.DefaultWorkingDirectory)\packages\*.vsix'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'