Build and test before versioning

This commit is contained in:
Wilson Lin 2020-07-10 20:44:01 +10:00
parent c626110160
commit f646c95f9e
1 changed files with 3 additions and 1 deletions

View File

@ -66,6 +66,9 @@ const replaceInFile = (path, pattern, replacement) => writeFileSync(path, readFi
if (cmd('git', 'status', '--porcelain', {throwOnStderr: true, captureStdio: true}).stdout) {
throw new Error('Working directory not clean');
}
cmd('bash', './gen.sh', {workingDir: join(__dirname, 'gen')});
// This will also build.
cmd('cargo', 'test');
for (const f of ['Cargo.toml', 'cli/Cargo.toml', 'nodejs/native/Cargo.toml', 'java/Cargo.toml', 'python/Cargo.toml', 'ruby/Cargo.toml']) {
replaceInFile(f, /^version = "\d+\.\d+\.\d+"\s*$/m, `version = "${NEW_VERSION}"`);
@ -99,7 +102,6 @@ for (const f of ['README.md', 'bench/README.md']) {
replaceInFile(f, /(wilsonl\.in\/hyperbuild\/bench\/)\d+\.\d+\.\d+/g, `$1${NEW_VERSION}`);
}
cmd('bash', './gen.sh', {workingDir: join(__dirname, 'gen')});
cmd('cargo', 'generate-lockfile');
cmd('git', 'add', '-A');
cmd('git', 'commit', '-m', NEW_VERSION);