Skip to content

Commit f69a1da

Browse files
committed
Add deploy to heroku
1 parent d2b198f commit f69a1da

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

script/release.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ checkToken()
1414
.then(createRelease)
1515
.then(uploadAssets)
1616
.then(publishRelease)
17+
.then(deployToHeroku)
1718
.catch((error) => {
1819
console.error(error.message || error)
1920
process.exit(1)
@@ -168,8 +169,30 @@ function publishRelease (release) {
168169
return reject(Error(`Non-200 response: ${response.statusCode}\n${util.inspect(body)}`))
169170
}
170171

171-
console.log(body.html_url)
172172
resolve(body)
173173
})
174174
})
175175
}
176+
177+
178+
function deployToHeroku () {
179+
return new Promise((resolve, reject) => {
180+
console.log('Deploying to heroku')
181+
182+
const herokuCommand = [
183+
'heroku',
184+
'config:set',
185+
'-a',
186+
'github-electron-api-demos',
187+
`ELECTRON_LATEST_RELEASE=${version}`
188+
].join(' ')
189+
190+
childProcess.exec(herokuCommand, (error) => {
191+
if (error) {
192+
reject(error)
193+
} else {
194+
resolve()
195+
}
196+
})
197+
})
198+
}

0 commit comments

Comments
 (0)