-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
58 lines (55 loc) · 1.57 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
pool:
vmImage: 'vs2017-win2016'
variables:
Modulename: AzDoAPITools
trigger:
batch: true
paths:
include:
- Source/*
- Tests/*
exclude:
- docs/*
- README.MD
- LICENSE.md
- Azure-pipelines.yml
- AzDoAPITools.*.ps1
stages:
- stage: Build_test
displayName: 'Build & Test'
jobs:
- job: Build
displayName: 'Build & Test'
steps:
- checkout: self
- task: PowerShell@2
inputs:
targetType: 'FilePath'
filePath: $(System.DefaultWorkingDirectory)/build.ps1
arguments: -task CICD
- task: CopyFiles@2
inputs:
Contents: |
$(modulename)*.*
build.ps1
TargetFolder: '$(System.DefaultWorkingDirectory)/BuildOutput'
- publish: $(System.DefaultWorkingDirectory)/BuildOutput
artifact: $(ModuleName)
- stage: Publish_to_PSGallery
displayName: 'Publish to PS Gallery'
dependsOn: Build_test
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
jobs:
- job: Publish
displayName: 'Publish To PS Gallery'
steps:
- checkout: none
- download: current
artifact: $(ModuleName)
- task: PowerShell@2
inputs:
targetType: 'FilePath'
filePath: $(pipeline.workspace)/$(modulename)/build.ps1
arguments: -task Publish
env:
PSGalleryKey : $(PSGalleryKey)