mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
build: add -dev flag
This commit is contained in:
1 parent
aeee124197
commit
64a77af8b2
1 file changed
+7
-1
+7
-1
@@ -8,6 +8,7 @@ const { gt } = require('semver');
|
|||||||
const latest = require('latest-version');
|
const latest = require('latest-version');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const ora = require('ora');
|
const ora = require('ora');
|
||||||
|
const { writeFileSync } = require('fs');
|
||||||
const { getWorkspaces, spawnAsync } = require('./utils');
|
const { getWorkspaces, spawnAsync } = require('./utils');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -55,8 +56,13 @@ if (CI && (!tag || GITHUB_EVENT_NAME !== 'push')) {
|
|||||||
if (Object.keys(bumpMap).length) {
|
if (Object.keys(bumpMap).length) {
|
||||||
for (const name in bumpMap) {
|
for (const name in bumpMap) {
|
||||||
console.log(`publishing ${name}@${bumpMap[name]} ...`);
|
console.log(`publishing ${name}@${bumpMap[name]} ...`);
|
||||||
|
if (tag === 'dev') {
|
||||||
|
const pkg = require(`${name}/package.json`);
|
||||||
|
pkg.version += '-dev';
|
||||||
|
writeFileSync(path.resolve(`${name}/package.json`), JSON.stringify(pkg));
|
||||||
|
}
|
||||||
await spawnAsync(
|
await spawnAsync(
|
||||||
`yarn npm publish --new-version ${bumpMap[name]}${tag === 'dev' ? '-dev' : ''} --access public --tag ${tag}`,
|
`yarn npm publish --access public --tag ${tag}`,
|
||||||
path.resolve(name),
|
path.resolve(name),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user