Skip to content

Commit daa2438

Browse files
committed
Add npm publish to bot for main repo
1 parent 074641f commit daa2438

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

tasks/admin/register.js

+15-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@
1111
let
1212
// node dependencies
1313
process = require('child_process'),
14+
fs = require('fs'),
1415

1516
npmPublish = require('@jsdevtools/npm-publish'),
1617

1718
// config
1819
release = require('../config/admin/release'),
1920

21+
config = fs.existsSync(__dirname + '/../config/admin/oauth.js')
22+
? require('../config/admin/oauth')
23+
: false,
24+
2025
// register components and distributions
2126
repos = release.distributions.concat(release.components),
2227
total = repos.length,
@@ -26,9 +31,17 @@ let
2631
stepRepo
2732
;
2833

29-
module.exports = function(callback) {
34+
module.exports = async function(callback) {
3035

31-
console.log('Registering repos with package managers');
36+
console.log('Publishing main repo');
37+
await npmPublish({
38+
package: `./package.json`,
39+
token: config.npmToken,
40+
greaterVersionOnly: true,
41+
debug: function(log) {
42+
console.log(log);
43+
}
44+
});
3245

3346
// Do Git commands synchronously per component, to avoid issues
3447
stepRepo = async function() {
@@ -40,10 +53,6 @@ module.exports = function(callback) {
4053
}
4154

4255
let
43-
fs = require('fs'),
44-
config = fs.existsSync(__dirname + '/../config/admin/oauth.js')
45-
? require('../config/admin/oauth')
46-
: false,
4756
repo = repos[index].toLowerCase(),
4857
outputDirectory = `${release.outputRoot}${repo}/`,
4958
exec = process.exec,

0 commit comments

Comments
 (0)