2018-05-22 20:50:44 +03:00
|
|
|
build-steps: &build-steps
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Check for release
|
|
|
|
command: |
|
|
|
|
if [ -n "${RUN_RELEASE_BUILD}" ]; then
|
|
|
|
echo 'release build triggered from api'
|
|
|
|
echo 'export ELECTRON_RELEASE=1 TRIGGERED_BY_API=1' >> $BASH_ENV
|
|
|
|
fi
|
|
|
|
- run:
|
|
|
|
name: Bootstrap
|
|
|
|
command: |
|
|
|
|
if [ "$ELECTRON_RELEASE" == "1" ]; then
|
|
|
|
echo "Bootstrapping Electron for release build for $TARGET_ARCH"
|
|
|
|
script/bootstrap.py --target_arch=$TARGET_ARCH
|
|
|
|
else
|
|
|
|
echo "Bootstrapping Electron for debug build for $TARGET_ARCH"
|
|
|
|
script/bootstrap.py --target_arch=$TARGET_ARCH --dev
|
|
|
|
fi
|
|
|
|
- run:
|
|
|
|
name: Lint
|
|
|
|
command: npm run lint
|
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: |
|
|
|
|
if [ "$ELECTRON_RELEASE" == "1" ]; then
|
|
|
|
echo 'Building Electron for release'
|
|
|
|
script/build.py -c R
|
|
|
|
else
|
|
|
|
echo 'Building Electron for debug'
|
|
|
|
script/build.py -c D
|
|
|
|
fi
|
|
|
|
- run:
|
|
|
|
name: Create distribution
|
|
|
|
command: |
|
|
|
|
if [ "$ELECTRON_RELEASE" == "1" ]; then
|
|
|
|
echo 'Creating Electron release distribution'
|
|
|
|
script/create-dist.py
|
|
|
|
else
|
|
|
|
echo 'Skipping create distribution because build is not for release'
|
|
|
|
fi
|
|
|
|
- run:
|
|
|
|
name: Upload distribution
|
|
|
|
command: |
|
|
|
|
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" != "1" ]; then
|
|
|
|
echo 'Uploading Electron release distribution to github releases'
|
|
|
|
script/upload.py
|
|
|
|
elif [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" == "1" ]; then
|
|
|
|
echo 'Uploading Electron release distribution to s3'
|
|
|
|
script/upload.py --upload_to_s3
|
|
|
|
else
|
|
|
|
echo 'Skipping upload distribution because build is not for release'
|
|
|
|
fi
|
|
|
|
- run:
|
|
|
|
name: Setup for headless testing
|
|
|
|
command: |
|
|
|
|
if [ "$ELECTRON_RELEASE" != "1" ] && [ "$RUN_HEADLESS_TESTS" == "true" ]; then
|
|
|
|
echo 'Setup for headless testing'
|
|
|
|
sh -e /etc/init.d/xvfb start
|
|
|
|
else
|
|
|
|
echo 'Headless testing not needed'
|
|
|
|
fi
|
|
|
|
- run:
|
|
|
|
name: Test
|
|
|
|
environment:
|
|
|
|
MOCHA_FILE: junit/test-results.xml
|
|
|
|
MOCHA_REPORTER: mocha-junit-reporter
|
|
|
|
command: |
|
|
|
|
if [ "$ELECTRON_RELEASE" != "1" ] && [ "$RUN_TESTS" == "true" ]; then
|
|
|
|
echo 'Testing Electron debug build'
|
|
|
|
mkdir junit
|
|
|
|
script/test.py --ci
|
|
|
|
else
|
|
|
|
if [ "$ELECTRON_RELEASE" == "1" ]; then
|
|
|
|
echo 'Skipping testing on release build'
|
|
|
|
else
|
|
|
|
echo 'Skipping tests due to configuration'
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
- run:
|
|
|
|
name: Verify FFmpeg
|
|
|
|
command: |
|
|
|
|
if [ "$ELECTRON_RELEASE" != "1" ] && [ "$RUN_TESTS" == "true" ]; then
|
|
|
|
echo 'Verifying ffmpeg on debug build'
|
|
|
|
script/verify-ffmpeg.py
|
|
|
|
else
|
|
|
|
if [ "$ELECTRON_RELEASE" == "1" ]; then
|
|
|
|
echo 'Skipping verify ffmpeg on release build'
|
|
|
|
else
|
|
|
|
echo 'Skipping tests due to configuration'
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
- run:
|
|
|
|
name: Generate Typescript Definitions
|
|
|
|
command: |
|
|
|
|
if [ "$CREATE_TYPESCRIPT_DEFS" == "true" ]; then
|
|
|
|
npm run create-typescript-definitions
|
|
|
|
fi
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: out
|
|
|
|
paths:
|
|
|
|
- "*"
|
|
|
|
- store_test_results:
|
|
|
|
path: junit
|
|
|
|
- store_artifacts:
|
|
|
|
path: junit
|
|
|
|
- store_artifacts:
|
|
|
|
path: out/electron.d.ts
|
|
|
|
- store_artifacts:
|
|
|
|
path: out/electron-api.json
|
|
|
|
|
|
|
|
|
|
|
|
build-defaults: &build-defaults
|
|
|
|
docker:
|
|
|
|
- image: electronbuilds/electron:0.0.7
|
|
|
|
<<: *build-steps
|
2017-09-13 16:48:19 +03:00
|
|
|
|
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
electron-linux-arm:
|
2018-05-22 20:50:44 +03:00
|
|
|
environment:
|
|
|
|
TARGET_ARCH: arm
|
|
|
|
<<: *build-defaults
|
2017-11-24 05:03:02 +03:00
|
|
|
resource_class: 2xlarge
|
2018-05-22 20:50:44 +03:00
|
|
|
|
2017-12-13 22:42:01 +03:00
|
|
|
electron-linux-arm-test:
|
|
|
|
machine: true
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
2018-05-22 20:50:44 +03:00
|
|
|
at: /tmp/workspace/project/out
|
2017-12-13 22:42:01 +03:00
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Test in ARM docker container
|
|
|
|
command: |
|
|
|
|
if [ "$ELECTRON_RELEASE" != "1" ]; then
|
|
|
|
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
|
|
|
docker run -it \
|
|
|
|
--mount type=bind,source=/tmp/workspace,target=/tmp/workspace \
|
2018-03-09 06:07:50 +03:00
|
|
|
--rm electronbuilds/electronarm7:0.0.5 > version.txt
|
2017-12-13 22:42:01 +03:00
|
|
|
cat version.txt
|
|
|
|
if grep -q `script/get-version.py` version.txt; then
|
|
|
|
echo "Versions match"
|
|
|
|
else
|
|
|
|
echo "Versions do not match"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Skipping test for release build"
|
|
|
|
fi
|
2018-05-22 20:50:44 +03:00
|
|
|
|
|
|
|
electron-linux-arm-release-nightly:
|
|
|
|
environment:
|
|
|
|
TARGET_ARCH: arm
|
|
|
|
RUN_RELEASE_BUILD: true
|
|
|
|
<<: *build-defaults
|
|
|
|
resource_class: 2xlarge
|
|
|
|
|
2017-09-13 16:48:19 +03:00
|
|
|
electron-linux-arm64:
|
2018-05-22 20:50:44 +03:00
|
|
|
environment:
|
|
|
|
TARGET_ARCH: arm64
|
|
|
|
<<: *build-defaults
|
2017-11-24 05:03:02 +03:00
|
|
|
resource_class: 2xlarge
|
2018-05-22 20:50:44 +03:00
|
|
|
|
2017-12-13 22:42:01 +03:00
|
|
|
electron-linux-arm64-test:
|
|
|
|
machine: true
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
2018-05-22 20:50:44 +03:00
|
|
|
at: /tmp/workspace/project/out
|
2017-12-13 22:42:01 +03:00
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Test in ARM64 docker container
|
|
|
|
command: |
|
|
|
|
if [ "$ELECTRON_RELEASE" != "1" ]; then
|
|
|
|
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
|
|
|
docker run -it \
|
|
|
|
--mount type=bind,source=/tmp/workspace,target=/tmp/workspace \
|
2018-03-09 06:07:50 +03:00
|
|
|
--rm electronbuilds/electronarm64:0.0.6 > version.txt
|
2017-12-13 22:42:01 +03:00
|
|
|
cat version.txt
|
|
|
|
if grep -q `script/get-version.py` version.txt; then
|
|
|
|
echo "Versions match"
|
|
|
|
else
|
|
|
|
echo "Versions do not match"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Skipping test for release build"
|
|
|
|
fi
|
2018-05-22 20:50:44 +03:00
|
|
|
|
|
|
|
electron-linux-arm64-release-nightly:
|
|
|
|
environment:
|
|
|
|
TARGET_ARCH: arm64
|
|
|
|
RUN_RELEASE_BUILD: true
|
|
|
|
<<: *build-defaults
|
|
|
|
resource_class: 2xlarge
|
|
|
|
|
2017-09-13 16:48:19 +03:00
|
|
|
electron-linux-ia32:
|
2018-05-22 20:50:44 +03:00
|
|
|
environment:
|
|
|
|
TARGET_ARCH: ia32
|
|
|
|
DISPLAY: ':99.0'
|
|
|
|
RUN_TESTS: true
|
|
|
|
RUN_HEADLESS_TESTS: true
|
|
|
|
<<: *build-defaults
|
2017-09-28 20:05:42 +03:00
|
|
|
resource_class: xlarge
|
2018-05-22 20:50:44 +03:00
|
|
|
|
|
|
|
electron-linux-ia32-release-nightly:
|
|
|
|
environment:
|
|
|
|
TARGET_ARCH: ia32
|
|
|
|
RUN_RELEASE_BUILD: true
|
|
|
|
<<: *build-defaults
|
|
|
|
resource_class: xlarge
|
|
|
|
|
2017-11-22 05:17:19 +03:00
|
|
|
electron-linux-mips64el:
|
2018-05-22 20:50:44 +03:00
|
|
|
environment:
|
|
|
|
TARGET_ARCH: mips64el
|
|
|
|
<<: *build-defaults
|
2017-11-22 05:17:19 +03:00
|
|
|
resource_class: xlarge
|
2017-09-13 16:48:19 +03:00
|
|
|
|
|
|
|
electron-linux-x64:
|
2018-05-22 20:50:44 +03:00
|
|
|
environment:
|
|
|
|
TARGET_ARCH: x64
|
|
|
|
DISPLAY: ':99.0'
|
|
|
|
RUN_TESTS: true
|
|
|
|
RUN_HEADLESS_TESTS: true
|
|
|
|
CREATE_TYPESCRIPT_DEFS: true
|
|
|
|
<<: *build-defaults
|
|
|
|
resource_class: xlarge
|
|
|
|
|
|
|
|
electron-linux-x64-release-nightly:
|
|
|
|
environment:
|
|
|
|
TARGET_ARCH: x64
|
|
|
|
RUN_RELEASE_BUILD: true
|
|
|
|
<<: *build-defaults
|
2017-09-28 20:05:42 +03:00
|
|
|
resource_class: xlarge
|
2017-09-13 16:48:19 +03:00
|
|
|
|
2018-04-09 22:19:54 +03:00
|
|
|
electron-osx-x64:
|
|
|
|
environment:
|
|
|
|
TARGET_ARCH: x64
|
2018-05-22 20:50:44 +03:00
|
|
|
RUN_TESTS: true
|
2018-04-09 22:19:54 +03:00
|
|
|
macos:
|
2018-05-22 20:50:44 +03:00
|
|
|
xcode: "9.0"
|
|
|
|
<<: *build-steps
|
|
|
|
|
|
|
|
electron-osx-x64-release-nightly:
|
|
|
|
environment:
|
|
|
|
TARGET_ARCH: x64
|
|
|
|
RUN_RELEASE_BUILD: true
|
|
|
|
macos:
|
|
|
|
xcode: "9.0"
|
|
|
|
<<: *build-steps
|
2018-04-09 22:19:54 +03:00
|
|
|
|
|
|
|
electron-mas-x64:
|
|
|
|
environment:
|
|
|
|
TARGET_ARCH: x64
|
|
|
|
MAS_BUILD: 1
|
2018-05-22 20:50:44 +03:00
|
|
|
RUN_TESTS: true
|
2018-04-09 22:19:54 +03:00
|
|
|
macos:
|
2018-05-22 20:50:44 +03:00
|
|
|
xcode: "9.0"
|
|
|
|
<<: *build-steps
|
|
|
|
|
|
|
|
electron-mas-x64-release-nightly:
|
|
|
|
environment:
|
|
|
|
TARGET_ARCH: x64
|
|
|
|
MAS_BUILD: 1
|
|
|
|
RUN_RELEASE_BUILD: true
|
|
|
|
macos:
|
|
|
|
xcode: "9.0"
|
|
|
|
<<: *build-steps
|
|
|
|
|
2018-04-09 22:19:54 +03:00
|
|
|
|
2017-09-13 16:48:19 +03:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build-arm:
|
|
|
|
jobs:
|
|
|
|
- electron-linux-arm
|
2017-12-13 22:42:01 +03:00
|
|
|
- electron-linux-arm-test:
|
|
|
|
requires:
|
|
|
|
- electron-linux-arm
|
2017-09-13 16:48:19 +03:00
|
|
|
build-arm64:
|
|
|
|
jobs:
|
|
|
|
- electron-linux-arm64
|
2017-12-13 22:42:01 +03:00
|
|
|
- electron-linux-arm64-test:
|
|
|
|
requires:
|
|
|
|
- electron-linux-arm64
|
2017-09-13 16:48:19 +03:00
|
|
|
build-ia32:
|
|
|
|
jobs:
|
|
|
|
- electron-linux-ia32
|
|
|
|
build-x64:
|
2018-04-09 22:19:54 +03:00
|
|
|
jobs:
|
|
|
|
- electron-linux-x64
|
|
|
|
build-osx-x64:
|
|
|
|
jobs:
|
|
|
|
- electron-osx-x64
|
|
|
|
build-mas-x64:
|
|
|
|
jobs:
|
|
|
|
- electron-mas-x64
|
2018-05-22 20:50:44 +03:00
|
|
|
|
|
|
|
nightly-release-test:
|
|
|
|
triggers:
|
|
|
|
- schedule:
|
|
|
|
cron: "0 0 * * *"
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- 2-0-x
|
|
|
|
- 1-8-x
|
|
|
|
- 1-7-x
|
|
|
|
jobs:
|
|
|
|
- electron-linux-arm-release-nightly
|
|
|
|
- electron-linux-arm64-release-nightly
|
|
|
|
- electron-linux-ia32-release-nightly
|
|
|
|
- electron-linux-x64-release-nightly
|