mirror of
https://github.com/nexu-io/openmotion.git
synced 2026-12-06 16:19:46 +08:00
feat(release): auto-number candidates built from feature/motion
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
import assert from 'node:assert/strict';
|
||||
|
||||
export function testVersion(base, run, attempt = '1') {
|
||||
assert(/^\d+\.\d+\.\d+$/.test(base), 'Source version must be MAJOR.MINOR.PATCH');
|
||||
assert(/^[1-9]\d*$/.test(String(run)) && /^[1-9]\d*$/.test(String(attempt)), 'Use positive run and attempt numbers');
|
||||
const [major, minor, patch] = base.split('.').map(Number);
|
||||
return `${major}.${minor}.${patch + 1}-test.${run}.${attempt}`;
|
||||
}
|
||||
|
||||
export function checkReleaseVersion(version) {
|
||||
assert.match(version, /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-test\.[1-9]\d*(?:\.[1-9]\d*)*)?$/, 'Use MAJOR.MINOR.PATCH or MAJOR.MINOR.PATCH-test.N[.N]');
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ import { spawn } from 'node:child_process';
|
||||
import { releaseProfile } from '../shared/mcp-registry.ts';
|
||||
import { distributionFiles } from './distribution.ts';
|
||||
import { packageTemplateConfig } from '../shared/template-config.ts';
|
||||
import { checkReleaseVersion } from './release-version.mjs';
|
||||
export { checkReleaseVersion } from './release-version.mjs';
|
||||
import { checkReleaseVersion, testVersion } from './release-version.mjs';
|
||||
export { checkReleaseVersion, testVersion } from './release-version.mjs';
|
||||
|
||||
export const root = fileURLToPath(new URL('../', import.meta.url));
|
||||
// Git Bash tar interprets C: as a remote host; use Windows' native archive tool.
|
||||
@@ -20,12 +20,6 @@ export function targetInfo(target) {
|
||||
assert(info, `Unsupported target: ${target}`);
|
||||
return info;
|
||||
}
|
||||
export function testVersion(base, run, attempt = '1') {
|
||||
assert(/^\d+\.\d+\.\d+$/.test(base), 'Source version must be MAJOR.MINOR.PATCH');
|
||||
assert(/^[1-9]\d*$/.test(String(run)) && /^[1-9]\d*$/.test(String(attempt)), 'Use positive run and attempt numbers');
|
||||
const [major, minor, patch] = base.split('.').map(Number);
|
||||
return `${major}.${minor}.${patch + 1}-test.${run}.${attempt}`;
|
||||
}
|
||||
export async function run(command, args, options = {}) {
|
||||
await new Promise((resolve, reject) => {
|
||||
const child = spawn(command, args, { cwd: root, stdio: 'inherit', windowsHide: true, ...options });
|
||||
|
||||
Reference in New Issue
Block a user