Skip to content

Commit

Permalink
CI/release scripts (#5364)
Browse files Browse the repository at this point in the history
* chore(ci): add release scripts;
  • Loading branch information
DigitalBrainJS committed Dec 11, 2022
1 parent 1e58a65 commit f2547d0
Show file tree
Hide file tree
Showing 3 changed files with 11,217 additions and 350 deletions.
42 changes: 42 additions & 0 deletions bin/check-build-version.js
@@ -0,0 +1,42 @@
import fs from 'fs';
import assert from 'assert';
import axios from '../index.js';
import axiosBuild from '../dist/node/axios.cjs';
import inquirer from 'inquirer';

const {version, name} = JSON.parse(fs.readFileSync('./package.json'));

console.log('Checking versions...\n----------------------------')

console.log(`Package version: v${version}`);
console.log(`Axios version: v${axios.VERSION}`);
console.log(`Axios build version: v${axiosBuild.VERSION}`);
console.log(`----------------------------`);

assert.strictEqual(version, axios.VERSION, `Version mismatch between package and Axios`);
assert.strictEqual(version, axiosBuild.VERSION, `Version mismatch between package and build`);

console.log('PASSED\n');

const choices = [
`Yes, let's release Axios v${version} to npm`,
`No, don't do an npm release - I'll do it myself`
];

inquirer
.prompt([
{
type: 'list',
name: 'release',
message: `You have requested an npm release for ${name.toUpperCase()} v${version}. Are you sure?`,
choices
}
])
.then((answers) => {
if (choices.indexOf(answers.release)) {
console.warn('terminate...');
process.exit(1);
}
});


0 comments on commit f2547d0

Please sign in to comment.