forked from NodeOS/NodeOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish
More file actions
executable file
·36 lines (25 loc) · 718 Bytes
/
publish
File metadata and controls
executable file
·36 lines (25 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env node
const readdir = require('fs').readdir
const upload = require('prebuild/upload')
const PREBUILDS = 'prebuilds'
const PKG = require('../package.json')
const token = process.env.GITHUB_TOKEN
if(!token) throw 'GITHUB_TOKEN environment variable is not defined'
var prerelease = (new Date()).toISOString().substr(0,10)
const branch_name = process.env.BRANCH_NAME
if(branch_name && branch_name !== 'master') return
readdir(PREBUILDS, function(err, files)
{
if(err) throw err
const opts =
{
upload: token,
pkg: PKG,
prerelease: prerelease,
files: files.map(function(file){return PREBUILDS+'/'+file})
}
upload(opts, function(error)
{
if(error) throw error
})
})