|
1 | 1 | $ErrorActionPreference = "Stop"; |
2 | 2 | if (!$env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:versionType) { |
3 | 3 | # Not a try build. |
4 | | - if ($env:APPVEYOR_REPO_BRANCH -eq "beta") { |
| 4 | + if ($env:APPVEYOR_REPO_BRANCH -eq "beta" -and $env:feature_crowdinSync) { |
5 | 5 | # Upload files to Crowdin for translation |
6 | 6 | py -m pip install --no-warn-script-location requests |
7 | 7 | py appveyor\crowdinSync.py uploadSourceFile 2 output\nvda.pot 2>&1 |
8 | 8 | } |
9 | | - # Notify our server. |
10 | | - $exe = Get-ChildItem -Name output\*.exe |
11 | | - $hash = (Get-FileHash "output\$exe" -Algorithm SHA1).Hash.ToLower() |
12 | | - $apiVersion = (py -c "import sys; sys.path.append('source'); from addonAPIVersion import CURRENT; print('{}.{}.{}'.format(*CURRENT))") |
13 | | - echo apiversion: $apiVersion |
14 | | - $apiCompatTo = (py -c "import sys; sys.path.append('source'); from addonAPIVersion import BACK_COMPAT_TO; print('{}.{}.{}'.format(*BACK_COMPAT_TO))") |
15 | | - echo apiBackCompatTo: $apiCompatTo |
16 | | - $data = @{ |
17 | | - jobId=$env:APPVEYOR_JOB_ID; |
18 | | - commit=$env:APPVEYOR_REPO_COMMIT; |
19 | | - version=$env:version; versionType=$env:versionType; |
20 | | - apiVersion=$apiVersion; apiCompatTo=$apiCompatTo; |
21 | | - avVersion=$env:APPVEYOR_BUILD_VERSION; |
22 | | - branch=$env:APPVEYOR_REPO_BRANCH; |
23 | | - exe=$exe; hash=$hash; |
24 | | - artifacts=$artifacts |
| 9 | + # Notify our server, if this is an NV Access build. |
| 10 | + if ($env:APPVEYOR_REPO_NAME.StartsWith("nvaccess/")) { |
| 11 | + $exe = Get-ChildItem -Name output\*.exe |
| 12 | + $hash = (Get-FileHash "output\$exe" -Algorithm SHA1).Hash.ToLower() |
| 13 | + $apiVersion = (py -c "import sys; sys.path.append('source'); from addonAPIVersion import CURRENT; print('{}.{}.{}'.format(*CURRENT))") |
| 14 | + echo apiversion: $apiVersion |
| 15 | + $apiCompatTo = (py -c "import sys; sys.path.append('source'); from addonAPIVersion import BACK_COMPAT_TO; print('{}.{}.{}'.format(*BACK_COMPAT_TO))") |
| 16 | + echo apiBackCompatTo: $apiCompatTo |
| 17 | + $data = @{ |
| 18 | + jobId=$env:APPVEYOR_JOB_ID; |
| 19 | + commit=$env:APPVEYOR_REPO_COMMIT; |
| 20 | + version=$env:version; versionType=$env:versionType; |
| 21 | + apiVersion=$apiVersion; apiCompatTo=$apiCompatTo; |
| 22 | + avVersion=$env:APPVEYOR_BUILD_VERSION; |
| 23 | + branch=$env:APPVEYOR_REPO_BRANCH; |
| 24 | + exe=$exe; hash=$hash; |
| 25 | + artifacts=$artifacts |
| 26 | + } |
| 27 | + ConvertTo-Json -InputObject $data -Compress | Out-File -FilePath deploy.json |
| 28 | + Push-AppveyorArtifact deploy.json |
| 29 | + # Execute the deploy script on the NV Access server via ssh. |
| 30 | + # Warning: if the server address is changed, |
| 31 | + # The new address must be also included in appveyor\ssh_known_hosts in this repo |
| 32 | + # Otherwise ssh will freeze on input! |
| 33 | + cat deploy.json | ssh nvaccess@deploy.nvaccess.org nvdaAppveyorHook |
25 | 34 | } |
26 | | - ConvertTo-Json -InputObject $data -Compress | Out-File -FilePath deploy.json |
27 | | - Push-AppveyorArtifact deploy.json |
28 | | - # Execute the deploy script on the NV Access server via ssh. |
29 | | - # Warning: if the server address is changed, |
30 | | - # The new address must be also included in appveyor\ssh_known_hosts in this repo |
31 | | - # Otherwise ssh will freeze on input! |
32 | | - cat deploy.json | ssh nvaccess@deploy.nvaccess.org nvdaAppveyorHook |
33 | 35 |
|
34 | | - # Upload symbols to Mozilla. |
35 | | - py -m pip install --upgrade --no-warn-script-location pip |
36 | | - py -m pip install --no-warn-script-location requests |
37 | | - Try { |
38 | | - py appveyor\mozillaSyms.py |
39 | | - } |
40 | | - Catch { |
41 | | - Add-AppveyorMessage "Unable to upload symbols to Mozilla" |
| 36 | + # Upload symbols to Mozilla if feature enabled. |
| 37 | + if ($env:feature_buildSymbols -and $env:feature_uploadSymbolsToMozilla) { |
| 38 | + py -m pip install --upgrade --no-warn-script-location pip |
| 39 | + py -m pip install --no-warn-script-location requests |
| 40 | + Try { |
| 41 | + py appveyor\mozillaSyms.py |
| 42 | + } |
| 43 | + Catch { |
| 44 | + Add-AppveyorMessage "Unable to upload symbols to Mozilla" |
| 45 | + } |
42 | 46 | } |
43 | 47 | } |
0 commit comments