Skip to content

Commit c00c341

Browse files
author
xVanTuring
authored
[build] Merge pull request #9 from xVanTuring/dev
Update build-script
2 parents c582465 + af70814 commit c00c341

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ matrix:
1919
language: node_js
2020
node_js: "11"
2121
sudo: true
22+
env:
23+
- BUILD_PREBUILDS="1"
2224
- name: "Linux (glibc) - Node 8"
2325
os: linux
2426
dist: xenial
@@ -64,4 +66,5 @@ matrix:
6466
env:
6567
- CC="gcc-8"
6668
- CXX="g++-8"
67-
if: tag IS present
69+
- BUILD_PREBUILDS="1"
70+
if: commit_message =~ /(\[build\])|(\[dev\])/

appveyor.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
os: Visual Studio 2015
22
version: "{build}"
33
build: off
4-
skip_non_tags: true
54
platform: x64
65
environment:
76
matrix:
87
- nodejs_version: "8"
98
- nodejs_version: "10"
109
- nodejs_version: "11"
10+
BUILD_PREBUILDS: "1"
1111
install:
1212
- ps: Install-Product node $env:nodejs_version x64
1313
- npm install -g npm@5
1414
- cmd: git submodule update --init --recursive
1515
- npm install
1616
test_script:
17-
- npm test
17+
- npm test
18+
only_commits:
19+
message: /(\[build\])|(\[dev\])/

script/build-deploy.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@ const allVersion = [
55
{ r: "electron", t: "4.2.2" },
66
{ r: "electron", t: "5.0.1" },
77
]
8-
const exec = require('child_process').exec
9-
const command = "git rev-parse --abbrev-ref HEAD"
10-
const spawn = require('child_process').spawn
118
const async = require('async')
12-
exec(command, (err, stdout) => {
13-
if (!err) {
14-
let branch = stdout.replace("\n", "")
15-
if (branch === "master") {
16-
startBuild()
17-
} else {
18-
console.log(`Current Branch is ${branch}`);
19-
}
9+
if (process.env.BUILD_PREBUILDS) {
10+
11+
if (process.env.TRAVIS_BRANCH === "master" || process.env.APPVEYOR_REPO_BRANCH === "master") {
12+
startBuild()
13+
} else {
14+
console.log(`Current Branch is ${process.env.TRAVIS_BRANCH || process.env.APPVEYOR_REPO_BRANCH}`);
15+
console.log("Skip BUILD Now!")
2016
}
21-
})
17+
} else {
18+
console.log("Current Environment does not have BUILD_PREBUILDS variable.")
19+
console.log("Skip BUILD Now!")
20+
}
2221

2322

2423
function startBuild() {

0 commit comments

Comments
 (0)