2018-05-04 21:39:39 +03:00
|
|
|
version: 1.0.{build}
|
2018-07-12 17:34:10 +03:00
|
|
|
branches:
|
|
|
|
except:
|
|
|
|
- /^release$|^release-\d-\d-x$/
|
2018-05-04 21:39:39 +03:00
|
|
|
build_cloud: electron-16
|
|
|
|
image: electron-16-vs2017
|
|
|
|
environment:
|
|
|
|
DISABLE_CRASH_REPORTER_TESTS: true
|
|
|
|
build_script:
|
|
|
|
- ps: >-
|
2018-05-15 23:54:25 +03:00
|
|
|
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
|
|
|
|
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
|
|
|
|
} else {
|
|
|
|
Add-Path "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64"
|
|
|
|
$env:path = "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64;$env:path"
|
2018-07-12 17:34:10 +03:00
|
|
|
if($env:APPVEYOR_SCHEDULED_BUILD -eq 'True') {
|
|
|
|
$env:RUN_RELEASE_BUILD = "1"
|
|
|
|
}
|
2018-05-15 23:54:25 +03:00
|
|
|
$Message = (git log --format=%B -n 1 HEAD) | Out-String
|
|
|
|
if ((Test-Path Env:\RUN_RELEASE_BUILD)) {
|
|
|
|
$env:ELECTRON_RELEASE = '1'
|
|
|
|
Write-Output "release build triggered from api"
|
|
|
|
}
|
|
|
|
if ((Test-Path Env:\ELECTRON_RELEASE)) {
|
|
|
|
Write-Output "Running release build"
|
|
|
|
python script\bootstrap.py --target_arch=$env:TARGET_ARCH
|
|
|
|
python script\build.py -c R
|
|
|
|
python script\create-dist.py
|
|
|
|
} else {
|
|
|
|
Write-Output "Running debug build"
|
|
|
|
python script\bootstrap.py --target_arch=$env:TARGET_ARCH --dev
|
|
|
|
python script\build.py -c D
|
|
|
|
}
|
|
|
|
if ($? -ne 'True') {
|
|
|
|
throw "Build failed with exit code $?"
|
|
|
|
} else {
|
|
|
|
"Build succeeded."
|
|
|
|
}
|
2018-07-12 17:34:10 +03:00
|
|
|
Push-AppveyorArtifact out
|
2018-05-04 21:39:39 +03:00
|
|
|
}
|
|
|
|
test_script:
|
|
|
|
- ps: >-
|
|
|
|
if (Test-Path Env:\ELECTRON_RELEASE) {
|
|
|
|
Write-Output "Skipping tests for release build"
|
|
|
|
} else {
|
|
|
|
Write-Output "Running tests for debug build"
|
2018-07-06 00:53:11 +03:00
|
|
|
python script\test.py --ci --rebuild_native_modules
|
2018-05-04 21:39:39 +03:00
|
|
|
if ($LASTEXITCODE -ne '0') {
|
|
|
|
throw "Tests failed with exit code $LASTEXITCODE"
|
|
|
|
} else {
|
|
|
|
Write-Output "Tests succeeded."
|
|
|
|
}
|
|
|
|
python script\verify-ffmpeg.py
|
|
|
|
if ($LASTEXITCODE -ne '0') {
|
|
|
|
throw "Verify ffmpeg failed with exit code $LASTEXITCODE"
|
|
|
|
} else {
|
|
|
|
"Verify ffmpeg succeeded."
|
|
|
|
}
|
|
|
|
}
|
|
|
|
artifacts:
|
2018-07-12 17:34:10 +03:00
|
|
|
- path: test-results.xml
|
|
|
|
name: test-results.xml
|
|
|
|
deploy_script:
|
|
|
|
- ps: >-
|
|
|
|
if (Test-Path Env:\ELECTRON_RELEASE) {
|
|
|
|
if (Test-Path Env:\RUN_RELEASE_BUILD) {
|
|
|
|
Write-Output "Uploading Electron release distribution to s3"
|
|
|
|
& python script\upload.py --upload_to_s3
|
|
|
|
} else {
|
|
|
|
Write-Output "Uploading Electron release distribution to github releases"
|
|
|
|
& python script\upload.py
|
|
|
|
}
|
|
|
|
}
|