-
Notifications
You must be signed in to change notification settings - Fork 39
/
.appveyor.yml
126 lines (107 loc) · 4.86 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# AU template: https://github.com/majkinetor/au-packages-template
version: '{build}'
max_jobs: 1
image: Visual Studio 2019
# History plugin requires complete log
#clone_depth: 5
branches:
only:
- master
#build:
# verbosity: minimal
environment:
# Set au version to use or omit to use the latest. Specify branch name to use development version from Github
au_version:
au_push: true
# Force test: use 1 to test all, or N to split testing into N groups
au_test_groups: 1
# Github token to commit pushed packages to repository
github_user_repo: pauby/chocopackages
github_api_key:
secure: 5tsbhdApHx6WunUoMa7ZQ/DThECXU52clanPgPOA112NBDhr7rjuMihiT27hEIOC
# Mail credentials - for error notifications
mail_user:
secure: xxzrryH1TErXFSjxmYszGA== #https://ci.appveyor.com/tools/encrypt
mail_pass:
secure: mbhjWMn71xqeJLKdUovNZ+QJejPftjH8pU/WTY+KnKg= #https://ci.appveyor.com/tools/encrypt
mail_server: smtp.gmail.com
mail_port: 587
mail_enablessl: true
# ID of the gist used to save run results - create a gist under the github_user (secret or not) and grab the id - https://gist.github.com/name/id
# Optional, leave empty to create anonymous gist
gist_id: e3b29a09c77246998b82c9ad33f4be4a
# Force test: gist id for test results
gist_id_test:
secure: vp/m/ZI770vGNtD2163xVBUYdjWbOZzs+04yy9q3yk6R6jeB5udthp37piNPkf82
# Chocolatey API key - to push updated packages
api_key:
secure: /M7oXDYygCRlrVqlO0DjjhwvQogHLLG6m48VOZoM7Mr/OC5RuBLD8JueJtIZc9Sg # https://ci.appveyor.com/tools/encrypt
appveyor_rdp_password:
secure: CC+F6/yXM5KgZMVnjjHyBIaw8aK8oOCYipXqGfQUHEE=
init:
- git config --global user.email "[email protected]"
- git config --global user.name "Chocolatey"
- git config --global core.safecrlf false
#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
install:
- ps: 'Get-CimInstance win32_operatingsystem -Property Caption, OSArchitecture, Version | fl Caption, OSArchitecture, Version'
- ps: $PSVersionTable
- choco upgrade chocolatey -y --no-progress
- choco install curl -y --no-progress
- git --version
- choco --version
- ps: |
Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name 'ChocolateyVersion', 'Evergreen', 'Nevergreen' -Repository 'PSGallery'
Invoke-WebRequest -Uri https://github.com/pauby/capu/releases/download/0.1.2/capu-0.1.2.zip -OutFile capu.zip -UseBasicParsing
Expand-Archive capu.zip
Import-Module -Name .\capu\capu.psd1
# Note that this ^ is IN the c:\projects\chocopackages folder
# git clone -q https://github.com/majkinetor/au.git $Env:TEMP/au
# . "$Env:TEMP/au/scripts/Install-AU.ps1" $Env:au_version
- ps: |
"Build info"
' {0,-20} {1}' -f 'SCHEDULED BUILD:', ($Env:APPVEYOR_SCHEDULED_BUILD -eq 'true')
' {0,-20} {1}' -f 'FORCED BUILD:' , ($Env:APPVEYOR_FORCED_BUILD -eq 'true')
' {0,-20} {1}' -f 'RE BUILD:' , ($Env:APPVEYOR_RE_BUILD -eq 'true')
build_script:
- ps: |
Using module ChocolateyVersion
$ErrorActionPreference = 'Continue'
if ($Env:APPVEYOR_PROJECT_NAME -like '*test*') { ./test_all.ps1 "random $Env:au_test_groups"; return }
if ( ($Env:APPVEYOR_SCHEDULED_BUILD -ne 'true') -and ($Env:APPVEYOR_FORCED_BUILD -ne 'true') ) {
switch -regex ($Env:APPVEYOR_REPO_COMMIT_MESSAGE)
{
'\[AU (.+?)\]' { $forced = $Matches[1] }
'\[PUSH (.+?)\]' {
$packages = $Matches[1] -split ' '
Write-Host "PUSHING PACKAGES: $packages"
foreach ($package in $packages) {
Write-Host ("{0}`n{1}`n" -f ('-'*60), "PACKAGE: $package")
$package_dir = ls -recurse | ? { $_.Name -eq "$package.nuspec"} | select -First 1 | % Directory
if (!$package_dir) { Write-Warning "Can't find package '$package'"; continue }
pushd $package_dir
if (Test-Path update.ps1 -ea 0) { ./update.ps1 }
choco pack; Push-Package;
popd
}
return
}
}
}
./update_all.ps1 -ForcedPackages $forced
7z a au_temp.zip $Env:TEMP\chocolatey\au\*
artifacts:
- path: update_info.xml
- path: Update-AUPackages.md
- path: au_temp.zip
notifications:
- provider: Email
to: $(mail_user)
on_build_success: false
on_build_failure: true
on_build_status_changed: true
#on_finish:
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))