mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
bump prerelease
This commit is contained in:
15 files changed
+36
-40
No files matched your search
+6
-4
@@ -4,14 +4,14 @@ import { writeFileSync } from 'fs';
|
||||
import path from 'path';
|
||||
import ora from 'ora';
|
||||
import packageJson from 'package-json';
|
||||
import { gt } from 'semver';
|
||||
import { gt, prerelease } from 'semver';
|
||||
import { getWorkspaces, spawnAsync } from './utils';
|
||||
|
||||
const {
|
||||
CI, GITHUB_EVENT_NAME, GITHUB_REF,
|
||||
} = process.env;
|
||||
|
||||
const tag = GITHUB_REF === 'refs/heads/master' ? 'latest' : GITHUB_REF === 'refs/heads/develop' ? 'dev' : undefined;
|
||||
const tag = GITHUB_REF === 'refs/heads/master' ? 'latest' : GITHUB_REF === 'refs/heads/next' ? 'dev' : undefined;
|
||||
|
||||
if (CI && (!tag || GITHUB_EVENT_NAME !== 'push')) {
|
||||
console.log('publish skipped.');
|
||||
@@ -54,8 +54,10 @@ if (CI && (!tag || GITHUB_EVENT_NAME !== 'push')) {
|
||||
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));
|
||||
if (!prerelease(pkg.version)) {
|
||||
pkg.version += '-dev';
|
||||
writeFileSync(path.resolve(`${name}/package.json`), JSON.stringify(pkg));
|
||||
}
|
||||
}
|
||||
await spawnAsync(
|
||||
`yarn npm publish --access public --tag ${tag}`,
|
||||
|
||||
Reference in new issue
Block a user