Files
atom/script/publish-release
David Wilson 34e37f3159 Enable automated nightly Atom releases
This change adds automation for producing nightly Atom releases using
VSTS CI.  Most of the changes are just slight modifications to Atom's
existing build scripts to produce another build channel and publish
those artifacts in a way that can be installed and updated when new
releases are available.
2018-06-18 21:01:19 -07:00

41 lines
1.2 KiB
JavaScript

#!/usr/bin/env node
'use strict'
const path = require('path')
const glob = require('glob')
const publishRelease = require('publish-release')
const CONFIG = require('./config')
console.log(`Publishing GitHub release ${CONFIG.computedAppVersion}`)
const yargs = require('yargs')
const argv = yargs
.usage('Usage: $0 [options]')
.help('help')
.describe('assets-path', 'Path to the folder where all release assets are stored')
.wrap(yargs.terminalWidth())
.argv
let assetsPath = argv.assetsPath || path.join(CONFIG.repositoryRootPath, 'out')
let assets = glob.sync(path.join(assetsPath, '*(*.exe|*.zip|*.nupkg|*.tar.gz|*.rpm|*.deb|RELEASES*)'))
publishRelease({
token: process.env.GITHUB_TOKEN,
owner: 'atom',
repo: CONFIG.channel !== 'nightly' ? 'atom' : 'atom-nightly-releases',
name: CONFIG.computedAppVersion,
tag: CONFIG.computedAppVersion,
draft: false,
prerelease: CONFIG.channel !== 'stable',
reuseRelease: true,
skipIfPublished: true,
assets
}, function (err, release) {
if (err) {
console.log("An error occurred while publishing the release:\n\n", err)
} else {
console.log("Release published successfully: ", release.html_url)
}
})