yarn add -D @ecabuk/wp-version-bumper
On your gulpfile.js
file.
const path = require('path');
const {task} = require('gulp');
task('version', require('@ecabuk/wp-version-bumper')([{
file: path.resolve(__dirname, 'plugin.php'), // File path
search: /Version: (.*)/, // Search RegExp
replace: 'Version: #NEW_VERSION#' // Replace String. #NEW_VERSION# will be replaced with the new version number.
}]
));
gulp version [--major|minor|path [version]] [--prerelease <alpha|beta|rc>]
gulp version
gulp version --major
gulp version --minor 12
gulp version --major 1 --minor 0 --patch 0
gulp version --minor --prerelease rc