-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathazure-pipelines.yml
50 lines (45 loc) · 1.29 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
trigger:
paths:
exclude:
- azure-pipelines.yml
- .gitignore
- LICENSE
- README.md
branches:
include:
- main
variables:
- name: ModuleName
value: 'PSGraphQL'
pool:
vmImage: 'windows-latest'
jobs:
- job: PowerShell_CICD
workspace:
clean: all
steps:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Import-Module -Name Pester -Version 4.10.1
Invoke-Pester
ignoreLASTEXITCODE: true
- task: CopyFiles@2
displayName: 'Copy Module Source to Staging'
inputs:
SourceFolder: '$(Build.SourcesDirectory)\$(ModuleName)\'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)\$(ModuleName)\'
CleanTargetFolder: true
OverWrite: true
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)\$(ModuleName)'
ArtifactName: '$(ModuleName)'
publishLocation: 'Container'
- task: PSGalleryPackager@0
inputs:
apiKey: '$(PSGalleryApiKey)'
path: '$(Build.ArtifactStagingDirectory)\$(ModuleName)'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))