Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support filesToStage array #139

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# grunt-release

## DEPRECATION WARNING

***PLEASE READ***

lzilioli/grunt-release will be deleted from GitHub on or after 2017-01-01. Please stop relying on it before that date

[![Build Status](https://travis-ci.org/geddski/grunt-release.svg?branch=master)](https://travis-ci.org/geddski/grunt-release)
[![Dependency Status](https://david-dm.org/geddski/grunt-release.svg)](https://david-dm.org/geddski/grunt-release)
[![devDependency Status](https://david-dm.org/geddski/grunt-release/dev-status.svg)](https://david-dm.org/geddski/grunt-release#info=devDependencies)
Expand Down Expand Up @@ -160,6 +166,7 @@ The following are all the release steps, you can disable any you need to:
afterBump: [], // optional grunt tasks to run after file versions are bumped
beforeRelease: [], // optional grunt tasks to run after release version is bumped up but before release is packaged
afterRelease: [], // optional grunt tasks to run after release is packaged
filesToStage: [], // optional additional files to stage as part of the release commit. This may be useful if the tasks specified in afterBump modify the local filesystem.
updateVars: [], // optional grunt config objects to update (this will update/set the version property on the object specified)
github: {
apiRoot: 'https://git.example.com/v3', // Default: https://github.com
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"author": "Dave Geddes",
"license": "MIT",
"dependencies": {
"depd": "^1.1.0",
"shelljs": "^0.5.1",
"semver": "^4.3.6",
"superagent": "^1.2.0",
Expand Down
8 changes: 6 additions & 2 deletions tasks/grunt-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var request = require('superagent');
var Q = require('q');

module.exports = function(grunt){
require('depd')('lzilioli/grunt-release')('lzilioli/grunt-release will be deleted from GitHub on or after 2017-01-01. Please stop relying on it before that date.');
grunt.registerTask('release', 'Bump version, git tag, git push, npm publish', function(type){

function setup(file, type){
Expand Down Expand Up @@ -53,8 +54,10 @@ module.exports = function(grunt){
options.github.apiRoot = 'https://api.github.com'; // Default Github.com api
}

var filesToStage = options.filesToStage;
return {
files: options.additionalFiles,
filesToStage: filesToStage,
vars: options.updateVars,
newVersion: newVersion,
pkg: pkg
Expand Down Expand Up @@ -86,7 +89,8 @@ module.exports = function(grunt){
beforeReleaseTasks: [],
afterReleaseTasks: [],
beforeBumpTasks: [],
afterBumpTasks: []
afterBumpTasks: [],
filesToStage: []
}, (grunt.config.data[this.name] || {}).options);
var config = setup(options.file, type);

Expand Down Expand Up @@ -170,7 +174,7 @@ module.exports = function(grunt){
}

function add(){
var files = config.files.join(' ');
var files = config.files.concat(config.filesToStage).join(' ');
return run('git add ' + files, ' staged ' + files);
}

Expand Down