mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
chore(ci): fix version bump script by adding bump argument for target version;
This commit is contained in:
+8
-3
@@ -1,8 +1,11 @@
|
|||||||
import gulp from 'gulp';
|
import gulp from 'gulp';
|
||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import axios from './index.js';
|
import axios from './index.js';
|
||||||
|
import minimist from 'minimist'
|
||||||
|
|
||||||
gulp.task('default', async function(){
|
const argv = minimist(process.argv.slice(2));
|
||||||
|
|
||||||
|
gulp.task('default', async function(){
|
||||||
console.log('hello!');
|
console.log('hello!');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -70,8 +73,10 @@ const packageJSON = gulp.task('package', async function () {
|
|||||||
const env = gulp.task('env', async function () {
|
const env = gulp.task('env', async function () {
|
||||||
var npm = JSON.parse(await fs.readFile('package.json'));
|
var npm = JSON.parse(await fs.readFile('package.json'));
|
||||||
|
|
||||||
await fs.writeFile('./lib/env/data.js', Object.entries({
|
const envFilePath = './lib/env/data.js';
|
||||||
VERSION: npm.version
|
|
||||||
|
await fs.writeFile(envFilePath, Object.entries({
|
||||||
|
VERSION: (argv.bump || npm.version).replace(/^v/, '')
|
||||||
}).map(([key, value]) => {
|
}).map(([key, value]) => {
|
||||||
return `export const ${key} = ${JSON.stringify(value)};`
|
return `export const ${key} = ${JSON.stringify(value)};`
|
||||||
}).join('\n'));
|
}).join('\n'));
|
||||||
|
|||||||
Generated
+711
-600
File diff suppressed because it is too large
Load Diff
+5
-2
@@ -103,7 +103,7 @@
|
|||||||
"karma-sauce-launcher": "^4.3.6",
|
"karma-sauce-launcher": "^4.3.6",
|
||||||
"karma-sinon": "^1.0.5",
|
"karma-sinon": "^1.0.5",
|
||||||
"karma-sourcemap-loader": "^0.3.8",
|
"karma-sourcemap-loader": "^0.3.8",
|
||||||
"minimist": "^1.2.6",
|
"minimist": "^1.2.7",
|
||||||
"mocha": "^10.0.0",
|
"mocha": "^10.0.0",
|
||||||
"multer": "^1.4.4",
|
"multer": "^1.4.4",
|
||||||
"release-it": "^15.5.1",
|
"release-it": "^15.5.1",
|
||||||
@@ -153,6 +153,9 @@
|
|||||||
],
|
],
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"release-it": {
|
"release-it": {
|
||||||
|
"git": {
|
||||||
|
"commitMessage": "chore(release): v${version}"
|
||||||
|
},
|
||||||
"github": {
|
"github": {
|
||||||
"release": true
|
"release": true
|
||||||
},
|
},
|
||||||
@@ -168,7 +171,7 @@
|
|||||||
},
|
},
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"before:init": "npm test",
|
"before:init": "npm test",
|
||||||
"after:bump": "gulp version && npm run build && npm run test:build:version",
|
"after:bump": "gulp version --bump ${version} && npm run build && npm run test:build:version",
|
||||||
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
|
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user