Browse Source

Add npm publish to bot for main repo

pull/7101/head
jlukic 2 years ago
parent
commit
daa2438f04
1 changed files with 15 additions and 6 deletions
  1. 21
      tasks/admin/register.js

21
tasks/admin/register.js

@ -11,12 +11,17 @@
let let
// node dependencies // node dependencies
process = require('child_process'), process = require('child_process'),
fs = require('fs'),
npmPublish = require('@jsdevtools/npm-publish'), npmPublish = require('@jsdevtools/npm-publish'),
// config // config
release = require('../config/admin/release'), release = require('../config/admin/release'),
config = fs.existsSync(__dirname + '/../config/admin/oauth.js')
? require('../config/admin/oauth')
: false,
// register components and distributions // register components and distributions
repos = release.distributions.concat(release.components), repos = release.distributions.concat(release.components),
total = repos.length, total = repos.length,
@ -26,9 +31,17 @@ let
stepRepo stepRepo
; ;
module.exports = function(callback) {
module.exports = async function(callback) {
console.log('Registering repos with package managers');
console.log('Publishing main repo');
await npmPublish({
package: `./package.json`,
token: config.npmToken,
greaterVersionOnly: true,
debug: function(log) {
console.log(log);
}
});
// Do Git commands synchronously per component, to avoid issues // Do Git commands synchronously per component, to avoid issues
stepRepo = async function() { stepRepo = async function() {
@ -40,10 +53,6 @@ module.exports = function(callback) {
} }
let let
fs = require('fs'),
config = fs.existsSync(__dirname + '/../config/admin/oauth.js')
? require('../config/admin/oauth')
: false,
repo = repos[index].toLowerCase(), repo = repos[index].toLowerCase(),
outputDirectory = `${release.outputRoot}${repo}/`, outputDirectory = `${release.outputRoot}${repo}/`,
exec = process.exec, exec = process.exec,

Loading…
Cancel
Save