Skip to content

Commit e70b4ae

Browse files
committed
Auto-update using buho
1 parent b0b91c7 commit e70b4ae

File tree

5 files changed

+36
-6
lines changed

5 files changed

+36
-6
lines changed

package.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020
"scripts": {
2121
"BigRedButton": "scripts/BigRedButton",
2222
"build": "scripts/build",
23+
"ci": "scripts/ci",
2324
"install": "prebuild-install -d https://github.com/NodeOS/qemu/releases/download/v{version}/{platform}-{arch}.tar.gz || npm run build",
24-
"prepublish": "scripts/prepublish"
25+
"mergeOrRelease": "scripts/mergeOrRelease",
26+
"prepublish": "scripts/prepublish",
27+
"update": "buho-checkUpdate"
2528
},
2629
"repository": {
2730
"type": "git",
@@ -41,9 +44,14 @@
4144
},
4245
"homepage": "https://github.com/NodeOS/qemu#readme",
4346
"dependencies": {
44-
"prebuild-install": "1.1.0"
47+
"prebuild-install": "^1.1.0"
4548
},
4649
"devDependencies": {
47-
"prebuild": "^4.2.2"
50+
"buho": "^0.2.1",
51+
"prebuild": "^4.5.0"
52+
},
53+
"buho": {
54+
"type": "DirectoryIndex",
55+
"url": "http://wiki.qemu-project.org/download/"
4856
}
4957
}

scripts/build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
set -o pipefail
44

5+
56
TARGET_LIST=arm-softmmu,i386-softmmu,x86_64-softmmu
67

78
QEMU_VERSION=`node -p "require('./package.json').version"`

scripts/ci

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env sh
2+
3+
if [ "$SEMAPHORE_TRIGGER_SOURCE" = "scheduler" ]
4+
then
5+
npm run update
6+
else
7+
npm run BigRedButton
8+
fi

scripts/mergeOrRelease

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env sh
2+
3+
if [ "$SEMAPHORE_TRIGGER_SOURCE" != "scheduler" ] \
4+
&& [ "$SEMAPHORE_THREAD_RESULT" != "failed" ]
5+
then
6+
if [ "$BRANCH_NAME" = "master" ]
7+
then
8+
ci-publish
9+
else
10+
buho-merge
11+
fi
12+
fi

scripts/prepublish

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ const TRUNCATE_DIR = 'bin'
77

88

99
// http://stackoverflow.com/a/34597104/586382
10-
// NPM will run prepublish script after `npm install` (https://docs.npmjs.com/misc/scripts)
11-
// This ensures that when script is executed using `npm *` it is run only when the command is `npm publish`.
10+
// NPM will run prepublish script after `npm install`
11+
// (https://docs.npmjs.com/misc/scripts). This ensures that when script is
12+
// executed using `npm *` it is run only when the command is `npm publish`
1213
const npm_config_argv = process.env.npm_config_argv
1314
if(npm_config_argv && JSON.parse(npm_config_argv).original[0] === 'publish')
1415
fs.readdir(TRUNCATE_DIR, function(err, files)
1516
{
1617
if(err) throw err
1718

18-
files.forEach(fs.truncateSync.bind(null, TRUNCATE_DIR+'/'+file, 0))
19+
files.forEach(fs.truncateSync.bind(fs, TRUNCATE_DIR+'/'+file, 0))
1920
})

0 commit comments

Comments
 (0)