mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Default the channel based on the package.json, not the branch
This commit is contained in:
@@ -35,22 +35,8 @@ module.exports = (grunt) ->
|
||||
|
||||
# Options
|
||||
installDir = grunt.option('install-dir')
|
||||
buildDir = grunt.option('build-dir')
|
||||
buildDir ?= 'out'
|
||||
buildDir = path.resolve(buildDir)
|
||||
|
||||
channel = grunt.option('channel')
|
||||
releasableBranches = ['stable', 'beta']
|
||||
if process.env.APPVEYOR and not process.env.APPVEYOR_PULL_REQUEST_NUMBER
|
||||
channel ?= process.env.APPVEYOR_REPO_BRANCH if process.env.APPVEYOR_REPO_BRANCH in releasableBranches
|
||||
|
||||
if process.env.TRAVIS and not process.env.TRAVIS_PULL_REQUEST
|
||||
channel ?= process.env.TRAVIS_BRANCH if process.env.TRAVIS_BRANCH in releasableBranches
|
||||
|
||||
if process.env.JANKY_BRANCH
|
||||
channel ?= process.env.JANKY_BRANCH if process.env.JANKY_BRANCH in releasableBranches
|
||||
|
||||
channel ?= 'dev'
|
||||
buildDir = path.resolve(grunt.option('build-dir') ? 'out')
|
||||
channel = grunt.option('channel') ? getDefaultReleaseChannel()
|
||||
|
||||
metadata = packageJson
|
||||
appName = packageJson.productName
|
||||
@@ -310,3 +296,15 @@ module.exports = (grunt) ->
|
||||
unless process.platform is 'linux' or grunt.option('no-install')
|
||||
defaultTasks.push 'install'
|
||||
grunt.registerTask('default', defaultTasks)
|
||||
|
||||
getDefaultReleaseChannel = ->
|
||||
{version} = packageJson
|
||||
if version.match(/dev/) or isBuildingPR()
|
||||
'dev'
|
||||
else if version.match(/beta/)
|
||||
'beta'
|
||||
else
|
||||
'stable'
|
||||
|
||||
isBuildingPR = ->
|
||||
process.env.APPVEYOR_PULL_REQUEST_NUMBER? or process.env.TRAVIS_PULL_REQUEST?
|
||||
|
||||
Reference in New Issue
Block a user