-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
88 lines (75 loc) · 2.24 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
88 lines (75 loc) · 2.24 KB
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
trigger:
branches:
include:
- master
paths:
include:
- SecretManagement.PleasantPasswordServer.Extension
- SecretManagement.PleasantPasswordServer
exclude:
- azure-pipelines.yml
- .gitignore
- LICENSE
pr: none
stages:
- stage: Build
jobs:
- job: 'Linux'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Install-Module -Name InvokeBuild -Force -AllowClobber
pwsh: true
displayName: 'Install InvokeBuild'
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Invoke-Build -File './build.ps1' -Verbose
pwsh: true
displayName: 'Build Module'
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.Repository.LocalPath)/Release'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
displayName: 'Copy Release Folder to Staging Directory'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
displayName: 'Publish Artifact to Azure DevOps'
- stage: Deploy
dependsOn: Build
condition: succeeded()
jobs:
- job: 'DeployWork'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
displayName: 'Checkout sources'
- task: DownloadBuildArtifacts@0
inputs:
buildType: current
downloadType: single
artifactName: 'drop'
downloadPath: '$(System.ArtifactsDirectory)'
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
$dropDirectory = Join-Path -Path $env:SYSTEM_ARTIFACTSDIRECTORY -ChildPath 'drop'
$ModuleNameFull = Join-Path $dropDirectory -ChildPath "SecretManagement.PleasantPasswordServer"
Install-Module Microsoft.PowerShell.SecretManagement -Force
Import-Module -Name $ModuleNameFull -Verbose
Publish-Module -Path "$ModuleNameFull" -NuGetApiKey $env:PS_GALLERY_SECRET -Verbose
pwsh: true
env:
PS_GALLERY_SECRET: $(PSGallery)
displayName: 'Publish To PowerShell Gallery'