-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.yml
48 lines (46 loc) · 1.45 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
trigger:
tags:
include:
- v*
branches:
include:
- master
pool:
vmImage: 'windows-latest'
jobs:
- job: test
displayName: Unit tests
steps:
- powershell:
Install-Module Pester -Scope CurrentUser -Force
name: test_deps
displayName: Install tests' dependencies
- powershell: |
Invoke-Pester test/EnvVar.Tests.ps1
name: test_body
displayName: Run tests
- deployment: publish
displayName: Publish to PowerShell Gallery
dependsOn: [test]
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
environment: PSGallery
strategy:
runOnce:
deploy:
steps:
- powershell: |
Install-Module PowerShellGet -Scope CurrentUser -Force
name: deploy_deps
displayName: Install dependencies for deployment
- checkout: self
- powershell: |
New-Item EnvVar -ItemType Directory
Copy-Item test, EnvVar.psd1, EnvVar.psm1, LICENSE, README.md -Destination EnvVar -Recurse
name: deploy_prepare
displayName: Prepare files
- powershell: |
Publish-Module -Path EnvVar -NuGetApiKey $Env:NUGET_APIKEY
name: deploy_publish
displayName: Publish the module to PowerShell Gallery
env:
NUGET_APIKEY: $(nuget_api_secret)