Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easier for devs outside of NV Access to utilize the Appveyor build process #16221

Merged
merged 17 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
be8a3e9
appveyor.yml: Move the environment section above the init section.
Feb 22, 2024
abc77c1
appveyor.yml: Added a feature subsection to the environment section. …
Feb 23, 2024
747219f
appveyor.yml: Added a trackTiming feature, and check for it before ea…
Feb 23, 2024
99a7260
Revert "appveyor.yml: Added a trackTiming feature, and check for it b…
Feb 23, 2024
3005f49
appveyor/scripts/logCiTiming.ps1: added a test to exit if the timing …
Feb 22, 2024
23e5d5d
appveyor/scripts/buildSymbolStore.ps1: Added a test for feature_build…
Feb 22, 2024
d02738a
appveyor.yml: Added logic to check the setting of the buildSymbols fe…
Feb 24, 2024
02bccbc
appveyor/scripts/deployScript.ps1: Only upload symbols to Mozilla, if…
Feb 22, 2024
3862939
appveyor/scripts/deployScript.ps1: Cause crowdin synchronization to b…
Feb 22, 2024
72a6496
appveyor/scripts/deployScript.ps1: Only deploy to the NV Access serve…
Feb 20, 2024
104ff80
In appveyor.yml and appveyor/scripts/setSconsArgs.ps1: use the scons_…
Feb 22, 2024
def7eed
appveyor/scripts/setSconsArgs.ps1: Don't include cert options if not …
Feb 23, 2024
32b0ea2
appveyor/scripts/setSconsArgs.ps1: now respond to the buildAppx featu…
Feb 23, 2024
8a05b35
appveyor/scripts/pushPackagingInfo.ps1: Change the appveyor message w…
Feb 22, 2024
3122149
appveyor/scripts/decryptFilesForSigning.ps1: Do not attempt to decryp…
Feb 23, 2024
00ab66c
Better feature explanation comment in appveyor.yml. Edit changes.
Feb 23, 2024
af4f5fc
Apply suggestions from code review
seanbudd Mar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 20 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ branches:
- /try-.*/
- /release-.*/

# scripts that are called at very beginning, before repo cloning
init:
# set the init time for the build, used to calculate the time taken for each stage of the build.
- ps: |
"INIT, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append

environment:
PY_PYTHON: 3.11-32
secure_authenticode_pass:
Expand All @@ -31,6 +25,20 @@ environment:
crowdinProjectID: 598017
crowdinAuthToken:
secure: E3084gj4JeMZKvZIOLIhqZefuSo/tj7iYPt4yK0geOI/eQgmPvoXt37Xq0KwvXzvZiJny4AsMj1rKMTVxio8EG8KA0YsYYuy+WV1wpFRIn25zGQS+DZ/yycL75SmTWfr
scons_publisher: NV Access
# Comment out any of the feature_* variables to disable the respective build feature.
# They are checked for existence of content, not specific value.
feature_buildSymbols: True
feature_uploadSymbolsToMozilla: True
feature_buildAppx: True
feature_crowdinSync: True
feature_signing: True

# scripts that are called at very beginning, before repo cloning
init:
# set the init time for the build, used to calculate the time taken for each stage of the build.
- ps: |
"INIT, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append

install:
- ps: |
Expand All @@ -51,9 +59,12 @@ build_script:
- ps: appveyor\scripts\buildSymbolStore.ps1
# The server expects the symbols archive to be structured as ./*.ex_ not ./symbols/*.ex_.
# Change directory to package, as 7z will structure the archive using the relative path.
- cd symbols
- 7z a -tzip -r ..\output\symbols.zip *.dl_ *.ex_ *.pd_
- cd ..
- ps: >-
if ($env:feature_buildSymbols) {
cd symbols
7z a -tzip -r ..\output\symbols.zip *.dl_ *.ex_ *.pd_
cd ..
}
- ps: |
"BUILD_END, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append

Expand Down
4 changes: 4 additions & 0 deletions appveyor/scripts/buildSymbolStore.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
$ErrorActionPreference = "Stop";
if (!$env:feature_buildSymbols) {
exit
}

foreach ($syms in
# We don't just include source\*.dll because that would include system dlls.
"source\liblouis.dll", "source\*.pdb",
Expand Down
2 changes: 1 addition & 1 deletion appveyor/scripts/decryptFilesForSigning.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(!$env:APPVEYOR_PULL_REQUEST_NUMBER) {
if(!$env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:feature_signing) {
openssl enc -d -md sha256 -aes-256-cbc -pbkdf2 -salt -pass pass:$env:secure_authenticode_pass -in appveyor\authenticode.pfx.enc -out appveyor\authenticode.pfx
if($LastExitCode -ne 0) {
$errorCode=$LastExitCode
Expand Down
68 changes: 36 additions & 32 deletions appveyor/scripts/deployScript.ps1
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"
}
}
}
5 changes: 5 additions & 0 deletions appveyor/scripts/logCiTiming.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
$inputFile = "../timing.csv"
$processedTimesFile = "buildStageTimingWithElapsed.csv"

# Don't run if timing record was not created for some reason
if (!(Test-Path -LiteralPath $inputFile)) {
exit
}

$entries = Import-Csv -Path $inputFile -Header Stage, Time
$lastTime = Get-Date -Date $entries[0].Time

Expand Down
6 changes: 5 additions & 1 deletion appveyor/scripts/pushPackagingInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ $appVeyorUrl = "https://ci.appveyor.com"
$exe = Get-ChildItem -Name output\*.exe
if($?){
$exeUrl="$appVeyorUrl/api/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/output/$exe"
Add-AppveyorMessage "Build (for testing PR): $exeUrl"
if ($env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null) {
Add-AppveyorMessage "Build (for testing PR): $exeUrl"
} else {
Add-AppveyorMessage "Build (for testing branch): $exeUrl"
}
}
6 changes: 3 additions & 3 deletions appveyor/scripts/setSconsArgs.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ErrorActionPreference = "Stop";
$sconsOutTargets = "launcher developerGuide changes userGuide keyCommands client moduleList"
if(!$env:APPVEYOR_PULL_REQUEST_NUMBER) {
if(!$env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:feature_buildAppx) {
$sconsOutTargets += " appx"
}
$sconsArgs = "version=$env:version"
Expand All @@ -10,8 +10,8 @@ if ($env:release) {
if ($env:versionType) {
$sconsArgs += " updateVersionType=$env:versionType"
}
$sconsArgs += ' publisher="NV Access"'
if(!$env:APPVEYOR_PULL_REQUEST_NUMBER) {
$sconsArgs += " publisher=`"$env:scons_publisher`""
if (!$env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:feature_signing) {
$sconsArgs += " certFile=appveyor\authenticode.pfx certTimestampServer=http://timestamp.digicert.com"
}
$sconsArgs += " version_build=$env:APPVEYOR_BUILD_NUMBER"
Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ What's New in NVDA
Please refer to [the developer guide https://www.nvaccess.org/files/nvda/documentation/developerGuide.html#API] for information on NVDA's API deprecation and removal process.

- Instantiating ``winVersion.WinVersion`` objects with unknown Windows versions above 10.0.22000 such as 10.0.25398 returns "Windows 11 unknown" instead of "Windows 10 unknown" for release name. (#15992, @josephsl)
- Make the AppVeyor build process easier for NVDA forks, by adding configurable variables in appveyor.yml to disable or modify NV Access specific portions of the build scripts. (#16216, @XLTechie)
-

=== Deprecations ===
Expand Down