forked from nvaccess/nvda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it easier for devs outside of NV Access to utilize the Appveyor …
…build process (nvaccess#16221) Closes nvaccess#16216 Summary of the issue: Currently, for a developer to make a private Appveyor build of NVDA, requires maintaining different build scripts, in addition to an intricately modified appveyor.yml file, and feeding them to Appveyor on every build. This PR removes much of the difficulty from private Appveyor builds, by making the build process more configurable in appveyor.yml, without having to modify the build scripts at all to make a basic build work. In addition, it adds a few sensible state checks to a couple build scripts. It tries to avoid changing any of the existing logic, except where an if condition could be anded with another to achieve the desired result. Description of user facing changes None Description of development approach appveyor.yml: Move the environment section above the init section. Added a scons_publisher variable, to avoid hard-coding "NV Access" in the scons variable script. Those doing private builds should change it to reflect their (org) name. Added a feature subsection to the environment section. Included features to control: building symbols, Uploading symbols to Mozilla, building the appx, crowdinSync, and package signing. (For private builds, all of those features should be commented out, except, optionally, the one for building symbols.) Added logic to check the setting of the buildSymbols feature before building symbols. appveyor/scripts/buildSymbolStore.ps1: Added a test for feature_buildSymbols. appveyor/scripts/deployScript.ps1: Make symbol upload dependent on both the buildSymbols and uploadSymbolsToMozilla features being set in appveyor.yml. Cause crowdin synchronization to be dependent on its feature from appveyor.yml. Only deploy to the NV Access server, if it's an nvaccess owned repo. appveyor/scripts/setSconsArgs.ps1: Use the scons_publisher variable from appveyor.yml to designate the publisher, instead of hardcoding in the script. Don't include cert options if not signing based on feature in appveyor.yml. Respond to the buildAppx feature in appveyor.yml. appveyor/scripts/pushPackagingInfo.ps1: Change the appveyor message with the exe link to mention a "branch" instead of a "PR", if no PR number is set in the build. It is assumed that most private builds will be for branches, not PRs against their own clone. appveyor/scripts/decryptFilesForSigning.ps1: Do not attempt to decrypt files if signing feature is not set in appveyor.yml. appveyor/scripts/logCiTiming.ps1: added a test to exit if the timing record file is not found. Regarding the last: originally I included a feature to disable CI timing checks. I decided that feature was unnecessary so reverted it, but I kept the change to detect the missing timing file and silently exit rather than failing hard, since it makes sense that something else may cause that file not to exist, and we wouldn't want the build failing over it.
- Loading branch information
Showing
8 changed files
with
75 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,47 @@ | ||
$ErrorActionPreference = "Stop"; | ||
if (!$env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:versionType) { | ||
# Not a try build. | ||
if ($env:APPVEYOR_REPO_BRANCH -eq "beta") { | ||
if ($env:APPVEYOR_REPO_BRANCH -eq "beta" -and $env:feature_crowdinSync) { | ||
# Upload files to Crowdin for translation | ||
py -m pip install --no-warn-script-location requests | ||
py appveyor\crowdinSync.py uploadSourceFile 2 output\nvda.pot 2>&1 | ||
} | ||
# Notify our server. | ||
$exe = Get-ChildItem -Name output\*.exe | ||
$hash = (Get-FileHash "output\$exe" -Algorithm SHA1).Hash.ToLower() | ||
$apiVersion = (py -c "import sys; sys.path.append('source'); from addonAPIVersion import CURRENT; print('{}.{}.{}'.format(*CURRENT))") | ||
echo apiversion: $apiVersion | ||
$apiCompatTo = (py -c "import sys; sys.path.append('source'); from addonAPIVersion import BACK_COMPAT_TO; print('{}.{}.{}'.format(*BACK_COMPAT_TO))") | ||
echo apiBackCompatTo: $apiCompatTo | ||
$data = @{ | ||
jobId=$env:APPVEYOR_JOB_ID; | ||
commit=$env:APPVEYOR_REPO_COMMIT; | ||
version=$env:version; versionType=$env:versionType; | ||
apiVersion=$apiVersion; apiCompatTo=$apiCompatTo; | ||
avVersion=$env:APPVEYOR_BUILD_VERSION; | ||
branch=$env:APPVEYOR_REPO_BRANCH; | ||
exe=$exe; hash=$hash; | ||
artifacts=$artifacts | ||
# Notify the NV Access server if this is an NV Access build. | ||
if ($env:APPVEYOR_REPO_NAME.StartsWith("nvaccess/")) { | ||
$exe = Get-ChildItem -Name output\*.exe | ||
$hash = (Get-FileHash "output\$exe" -Algorithm SHA1).Hash.ToLower() | ||
$apiVersion = (py -c "import sys; sys.path.append('source'); from addonAPIVersion import CURRENT; print('{}.{}.{}'.format(*CURRENT))") | ||
echo apiversion: $apiVersion | ||
$apiCompatTo = (py -c "import sys; sys.path.append('source'); from addonAPIVersion import BACK_COMPAT_TO; print('{}.{}.{}'.format(*BACK_COMPAT_TO))") | ||
echo apiBackCompatTo: $apiCompatTo | ||
$data = @{ | ||
jobId=$env:APPVEYOR_JOB_ID; | ||
commit=$env:APPVEYOR_REPO_COMMIT; | ||
version=$env:version; versionType=$env:versionType; | ||
apiVersion=$apiVersion; apiCompatTo=$apiCompatTo; | ||
avVersion=$env:APPVEYOR_BUILD_VERSION; | ||
branch=$env:APPVEYOR_REPO_BRANCH; | ||
exe=$exe; hash=$hash; | ||
artifacts=$artifacts | ||
} | ||
ConvertTo-Json -InputObject $data -Compress | Out-File -FilePath deploy.json | ||
Push-AppveyorArtifact deploy.json | ||
# Execute the deploy script on the NV Access server via ssh. | ||
# Warning: if the server address is changed, | ||
# The new address must be also included in appveyor\ssh_known_hosts in this repo | ||
# Otherwise ssh will freeze on input! | ||
cat deploy.json | ssh nvaccess@deploy.nvaccess.org nvdaAppveyorHook | ||
} | ||
ConvertTo-Json -InputObject $data -Compress | Out-File -FilePath deploy.json | ||
Push-AppveyorArtifact deploy.json | ||
# Execute the deploy script on the NV Access server via ssh. | ||
# Warning: if the server address is changed, | ||
# The new address must be also included in appveyor\ssh_known_hosts in this repo | ||
# Otherwise ssh will freeze on input! | ||
cat deploy.json | ssh nvaccess@deploy.nvaccess.org nvdaAppveyorHook | ||
|
||
# Upload symbols to Mozilla. | ||
py -m pip install --upgrade --no-warn-script-location pip | ||
py -m pip install --no-warn-script-location requests | ||
Try { | ||
py appveyor\mozillaSyms.py | ||
} | ||
Catch { | ||
Add-AppveyorMessage "Unable to upload symbols to Mozilla" | ||
# Upload symbols to Mozilla if feature enabled. | ||
if ($env:feature_buildSymbols -and $env:feature_uploadSymbolsToMozilla) { | ||
py -m pip install --upgrade --no-warn-script-location pip | ||
py -m pip install --no-warn-script-location requests | ||
Try { | ||
py appveyor\mozillaSyms.py | ||
} | ||
Catch { | ||
Add-AppveyorMessage "Unable to upload symbols to Mozilla" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters