-
Notifications
You must be signed in to change notification settings - Fork 4
/
build-publish.yml
34 lines (34 loc) · 1.16 KB
/
build-publish.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
variables:
- template: pipeline-templates/global-variables.yml
trigger:
branches:
include:
- master
- release-*
paths:
exclude:
- README.md
pr: none
jobs:
- job: Build
displayName: "Build PowerShell module and publish to PowerShell Gallery"
pool:
vmImage: 'windows-latest'
steps:
- template: pipeline-templates/build-steps.yml
- task: AzureKeyVault@1
inputs:
azureSubscription: 'OneIdentity.RD.SBox.Safeguard-ServiceConnection'
KeyVaultName: 'SafeguardBuildSecrets'
SecretsFilter: 'PowerShellGalleryApiKey'
displayName: 'Get PowerShell Gallery API key from Sandbox Azure Key Vault'
- task: PowerShell@2
inputs:
targetType: inline
failOnStderr: true
script: |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-PackageProvider Nuget –Force
Get-PSRepository
Publish-Module -Name safeguard-discovery -NuGetApiKey "$(PowerShellGalleryApiKey)" -Verbose -SkipAutomaticTags -Force
displayName: 'Publish PowerShell module to PowerShell Gallery'