-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
79 lines (66 loc) · 2.81 KB
/
appveyor.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# YAML Reference Guide: https://www.appveyor.com/docs/appveyor-yml/
# Environmental Variables Guide: https://www.appveyor.com/docs/environment-variables/
# YAML Validator: https://ci.appveyor.com/tools/validate-yaml
image: Visual Studio 2015
# scripts that are called at very beginning, before repo cloning
init:
- git config --global core.autocrlf true
- git config --global user.email "tomas.deceuninck@gmail.com"
- git config --global user.name "Tomas Deceuninck"
# Only build commits to these branches
branches:
only:
- master
- dev
# Ignore testing a commit if only the README.md file changed
# Or if various strings are found in the commit message: updated readme, update readme, update docs, update version, update appveyor
skip_commits:
files:
- README.md
- CONTRIBUTING.md
- .github/
- .vscode/
message: /updated readme.*|update readme.*s|update docs.*|update version.*|update appveyor.*/
# Do not build on tags
skip_tags: true
# There's no need to alter the build number for a Pull Request (PR) since they don't modify anything
pull_requests:
do_not_increment_build_number: true
# PowerShell Gallery API key for publishing an update to the module
# The "secure:" value is the Appveyor encryption of the key
environment:
NuGetApiKey:
secure: yPYUYzpttyLw7Mq/97hPGOC0TPb64MlsVl5O6uzpPixgbmXjm+lv+6BImdzMWDZk
GitHubKey:
secure: lpvXEmnT6cnoq/CDBB1lrc3UaEP2EBbQz6iIHc1pRi9QB8SUwVF3Xs+/5ctuKTE0
# Install NuGet to interact with the PowerShell Gallery
install:
- ps: |
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.208 -Force | Out-Null
Install-Module -Name InvokeBuild -Force | Out-Null
Install-Module -Name Pester -Force | Out-Null
Install-Module -Name PSScriptAnalyzer -Force | Out-Null
Install-Module -Name PlatyPS -Force | Out-Null
before_build:
- ps: |
Invoke-Build -Task ShowAppVeyorDebug
Invoke-Build -Task GetVersion
# run your custom scripts instead of automatic MSBuild
build_script:
- ps: Invoke-Build -Task AppVeyorBuild
# Invoke Pester to run all of the unit tests, then save the results into XML in order to populate the AppVeyor tests section
# If any of the tests fail, consider the pipeline failed
test_script:
- ps: Invoke-Build -Task PesterTests
# scripts to run before deployment
deploy_script:
- ps: Invoke-Build -Task AppVeyorPublish
on_success:
- ps: |
git config --global credential.helper store
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:GitHubKey):x-oauth-basic@github.com`n"
git add --all
git commit -m "Update version to $env:APPVEYOR_BUILD_VERSION"
git rebase HEAD $env:APPVEYOR_REPO_BRANCH
git push
Write-Host "$ModuleName PowerShell Module version $env:APPVEYOR_BUILD_VERSION published to GitHub." -ForegroundColor Cyan