-
Notifications
You must be signed in to change notification settings - Fork 47
/
appveyor.yml
116 lines (106 loc) · 4.14 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
version: "b{build}"
branches:
only:
- master
environment:
matrix:
- job_name: Windows
appveyor_build_worker_image: Visual Studio 2022
PY_PYTHON: 3.9-32
- job_name: Mac
appveyor_build_worker_image: macos-bigsur
global:
encFileKey:
secure: hN4Qfteiu6qqPajSvT+vrPfVoazOY+MFAlwUt/kZSnM=
crowdinAuthToken:
secure: 7DTljIEjNzKsCtWTf9iKT8LhRApXcEnPVzIoN1puxBeGhQlp9UcHOT/LQIp4Ddo6jU74HoZn4D9UzdjsEgRgEj34QGDv+gjpsc9HN9PevKho1TYfAZDEAVM0OZl2NaVt
init:
- ps: |
If (([regex]::Matches($env:APPVEYOR_BUILD_VERSION, "," )).count -eq 0) {
If ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
Update-AppveyorBuild -Version ("pr$env:APPVEYOR_PULL_REQUEST_NUMBER-$env:APPVEYOR_BUILD_NUMBER," + $env:APPVEYOR_REPO_COMMIT.Substring(0, 8))
} Else {
Update-AppveyorBuild -Version ($(Get-Date -Format "yyyy.M.d") + ".$env:APPVEYOR_BUILD_NUMBER," + $env:APPVEYOR_REPO_COMMIT.Substring(0, 8))
}
}
- cmd: py -m pip --disable-pip-version-check install --no-warn-script-location scons
- sh: pip3 install --user scons
clone_depth: 1
install:
# There's no point in building if we're going to fail the build because of
# unsorted key maps, so we do this as early as we can.
- cmd: py tools/sortKeymap.py -t config/windows/reaper-kb.ini
- cmd: py tools/sortKeymap.py -t config/mac/reaper-kb.ini
- ps: |
If (!$env:APPVEYOR_PULL_REQUEST_NUMBER) {
cd ci
# Decrypt files.
openssl enc -aes-256-cbc -md md5 -d -pass pass:$env:encFileKey -in ssh_id_rsa.enc -out ssh_id_rsa
# Install ssh stuff.
If ($IsMacOS) {
mkdir $HOME/.ssh
chmod 700 $HOME/.ssh
}
Copy-Item ssh_id_rsa $HOME/.ssh/id_rsa
If ($IsMacOS) {
chmod 600 $HOME/.ssh/id_rsa
}
Add-Content -Path $HOME/.ssh/known_hosts -Value $(Get-Content ssh_known_hosts )
cd ..
}
- git submodule update --init --depth 1
- sh: sudo xcode-select -s /Applications/Xcode-13.2.1.app
# Use NSIS v2.46 to reduce AV false positives. Borrowed from SWS.
- cmd: '"%ProgramFiles(x86)%\NSIS\uninst-nsis.exe" /S'
- cmd: choco install -y nsis-unicode
build_script:
- ps: |
If ($IsWindows) { $scons = "c:\python39\scripts\scons.exe" } Else { $scons = "/Users/appveyor/Library/Python/3.8/bin/scons" }
# We only build the pot on Windows. The choice of which OS is
# arbitrary, but there's no point in building it on both.
If ($IsWindows) { $targets = "installer", "pot" }
# workaround for Warnings written to stderr that cause the appveyor build to fail
$ErrorActionPreference = "SilentlyContinue"
& $scons version=$env:APPVEYOR_BUILD_VERSION publisher="James Teh" $targets
$ErrorActionPreference = "Stop"
if($LastExitCode) {
throw "Scons exited with code $LastExitCode"
}
artifacts:
- path: installer/*.exe
- path: installer/*.dmg
- path: locale/*.pot
deploy_script:
- ps: |
If (!$env:APPVEYOR_PULL_REQUEST_NUMBER) {
$installer = Get-ChildItem -Name installer/*.exe, installer/*.dmg
$data = @{
os=$(If ($IsWindows) { "win" } Else { "mac" });
jobId=$env:APPVEYOR_JOB_ID;
version=$env:APPVEYOR_BUILD_VERSION;
commit=$env:APPVEYOR_REPO_COMMIT;
installer=$installer
}
if ($IsWindows) { $data["pot"] = Get-ChildItem -Name locale/*.pot }
ConvertTo-Json -InputObject $data -Compress | ssh [email protected] osaraCiHook
if ($IsWindows) {
py -m pip --disable-pip-version-check install --no-warn-script-location requests
# We must explicitly specify the Python version here because
# crowdinSync has a shebang line which causes the wrong version to be
# used.
py -3.9-32 ci\crowdinSync uploadPot
}
}
notifications:
- provider: GitHubPullRequest
on_build_status_changed: false
template: |-
{{#passed}}Build succeeded!{{/passed}}{{#failed}}Build failed!{{/failed}} [Build {{&projectName}} {{buildVersion}} {{status}}]({{buildUrl}}) (commit {{commitUrl}} by @{{&commitAuthorUsername}})
{{#passed}}Downloads:{{#jobs}}
<details>
<summary>{{name}}</summary>
{{#artifacts}}
- [{{fileName}}]({{permalink}})
{{/artifacts}}
</details>
{{/jobs}}{{/passed}}