-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.appveyor.yml
95 lines (86 loc) · 3.22 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
image: WMF 5
# Skip on updates to the readme.
# We can force this by adding [skip ci] or [ci skip] anywhere in commit message
skip_commits:
message: /update(?:|d|s) readme\..*/
environment:
# CODECOV_TOKEN is different per repo.
CODECOV_TOKEN:
secure: w+GT9vRf1O7O+fxXtIHV5UiCO1m8ICJEiHi/NFM8adnRUBVQoskrLY9teCdFVOF4
artifacts:
- path: dev\PSRedstone.zip
name: PSRedstone.zip
init:
- ps: |
if ($env:APPVEYOR_REPO_TAG -eq 'true' -and $env:APPVEYOR_REPO_TAG_NAME.StartsWith('v')) {
Add-AppveyorMessage -Message ('Git tag already published; Stopping Build.') -Category 'Information' -Details ($details | ConvertTo-Json)
Exit-AppVeyorBuild
} elseif ($env:APPVEYOR_REPO_TAG -eq 'true') {
$env:MODULE_VERSION = ((Get-Date -Format 'yyyy.MM.dd'), $env:APPVEYOR_BUILD_NUMBER) -join '.'
Update-AppveyorBuild -Version ${env:MODULE_VERSION}
$details = [ordered] @{
APPVEYOR_REPO_TAG = $env:APPVEYOR_REPO_TAG
APPVEYOR_REPO_TAG_NAME = $env:APPVEYOR_REPO_TAG_NAME
MODULE_VERSION = $env:MODULE_VERSION
}
Add-AppveyorMessage -Message ('Git tag to publish Version: {0}' -f $env:MODULE_VERSION) -Category 'Information' -Details ($details | ConvertTo-Json)
} else {
Add-AppveyorMessage -Message 'Git Push, just running checks.' -Category 'Information'
}
install:
# Bootstrap PSDepend and Install Dependencies
- ps: |
# $InformationPreference = 'Continue'
& ([IO.Path]::Combine($env:APPVEYOR_BUILD_FOLDER, '.build', 'buildPrep.ps1'))
on:
branch: master # release from master branch only
build_script:
- ps: |
$invokePsake = @{
BuildFile = [IO.Path]::Combine($env:APPVEYOR_BUILD_FOLDER, '.build', 'buildPsake.ps1')
# TaskList = @('Build')
}
Invoke-psake @invokePsake
if (-not $psake.build_success) {
$Host.SetShouldExit(1)
}
on:
branch: master # release from master branch only
after_build:
# Upload coverage report to codecov
# Also, if we're tagged, delete the tag to prep for publishing release.
- ps: |
$invokePsake = @{
BuildFile = [IO.Path]::Combine($env:APPVEYOR_BUILD_FOLDER, '.build', 'buildPsake.ps1')
TaskList = @('CodeCov', 'GitHubTagDelete')
}
Invoke-psake @invokePsake
if (-not $psake.build_success) {
$Host.SetShouldExit(1)
}
on:
branch: master # release from master branch only
deploy:
# Deploy to GitHub Releases
- tag: v$(APPVEYOR_BUILD_VERSION)
release: v$(APPVEYOR_BUILD_VERSION)
provider: GitHub
auth_token: $(GITHUB_PERSONAL_ACCESS_TOKEN)
artifact: PSRedstone.zip
draft: false
prerelease: false
on:
APPVEYOR_REPO_TAG: true
on_success:
# If build was started by pushed tag; deploy it.
- ps: |
if ($env:APPVEYOR_REPO_TAG -eq 'true' -and -not $env:APPVEYOR_REPO_TAG_NAME.StartsWith('v')) {
$invokePsake = @{
BuildFile = [IO.Path]::Combine($env:APPVEYOR_BUILD_FOLDER, '.build', 'buildPsake.ps1')
TaskList = @('DeployPSGallery', 'Docs')
}
Invoke-psake @invokePsake
if (-not $psake.build_success) {
$Host.SetShouldExit(1)
}
}