
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
grunt-release-plugin
Advanced tools
Calculate project version from git tags and mark SNAPSHOT versions.
Calculate project version from git tags and mark SNAPSHOT versions.
This plugin has two tasks:
currentVersion which calculates and prints projects current version object on the screen,metadata which prints all metatadata with calculated projects current version.compress which is a grunt-contrib-compress task. The path for created package is always the same - target/universal/projectName-calculatedCurrentVersion.zipIt is very useful when you need to calculate your project version in CI.
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-release-plugin --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-release-plugin');
In your project's Gruntfile, add a section named release_plugin to the data object passed into grunt.initConfig().
grunt.initConfig({
release_plugin: {
options: {
// Task-specific options go here.
},
currentVersion: {},
metadata: {},
compress: {...}
}
});
Type: String
Default value: .
A string value describes path to repository, usually current folder ..
Type: Object
Default value: {}
An object with version (which will be replaced) any any other stuff returned by metadata task, usually package.json
grunt.initConfig({
release_plugin: {
options: {
repo: ".",
pkg: grunt.file.readJSON('package.json')
},
currentVersion: {},
metadata: {},
compress: {
main: {
files: [
{
src: ['./dist/*'],
dest: '<%= pkg.name %>/',
filter: 'isFile'
}
]
}
}
}
});
git init
touch file.js
git add file.js
git commit -m "add file.js"
git tag -a v0.1.0 -m "v0.1.0"
grunt release_plugin:currentVersion #will return {"currentVersion":"0.1.0"}
touch file2.js
git add file2.js
git commit -m "add file2.js"
grunt release_plugin:currentVersion #will return {"currentVersion":"0.1.1-SNAPSHOT"}
git tag -a v0.1.1 -m "v0.1.1"
grunt release_plugin:currentVersion #will return {"currentVersion":"0.1.1"}
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
FAQs
Calculate project version from git tags and mark SNAPSHOT versions.
We found that grunt-release-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.