Skip to content

Commit ead8ba0

Browse files
committed
release with grunt-prompt instead of storing sensitive information in plaintext
1 parent a0db600 commit ead8ba0

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

Gruntfile.js

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33
// └─────────────┘
44
// Grunt wraps several tasks to ease development
55
// runs acetate, deploys the site, and tags new releases
6-
7-
// To draft a release, add GitHub credentials to user.js
86
var fs = require('fs');
9-
var user = function(){};
10-
11-
if (fs.existsSync('./user.js')) {
12-
user = require('./user.js');
13-
}
147

158
// Gets current version description from CHANGELOG.md
169
function findVersion(log) {
@@ -175,7 +168,6 @@ module.exports = function(grunt) {
175168
'github-release': {
176169
options: {
177170
repository: repo,
178-
auth: user(),
179171
release: {
180172
tag_name: currentVersion,
181173
name: currentVersion,
@@ -187,6 +179,26 @@ module.exports = function(grunt) {
187179
}
188180
},
189181

182+
// Ask for GitHub username and password
183+
'prompt': {
184+
github: {
185+
options: {
186+
questions: [
187+
{
188+
config: 'github-release.options.auth.user',
189+
type: 'input',
190+
message: 'GitHub username:'
191+
},
192+
{
193+
config: 'github-release.options.auth.password',
194+
type: 'password',
195+
message: 'GitHub password:'
196+
}
197+
]
198+
}
199+
}
200+
},
201+
190202
// Deploy the docs site to gh-pages
191203
'gh-pages': {
192204
options: {
@@ -207,6 +219,7 @@ module.exports = function(grunt) {
207219

208220
// Release a new version of the framework
209221
grunt.registerTask('release', [
222+
'prompt:github',
210223
'prepublish',
211224
'compress',
212225
'github-release'

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,20 @@
1212
"acetate": "0.0.7",
1313
"grunt": "~0.4.5",
1414
"grunt-acetate": "0.0.5",
15-
"grunt-contrib-imagemin": "^0.8.1",
16-
"grunt-contrib-sass": "^0.8.1",
17-
"grunt-contrib-watch": "~0.6.1",
15+
"grunt-concurrent": "^0.5.0",
16+
"grunt-contrib-compress": "^0.11.0",
1817
"grunt-contrib-concat": "^0.4.0",
18+
"grunt-contrib-copy": "^0.5.0",
19+
"grunt-contrib-imagemin": "^0.8.1",
1920
"grunt-contrib-jshint": "^0.10.0",
21+
"grunt-contrib-sass": "^0.8.1",
2022
"grunt-contrib-uglify": "^0.4.0",
21-
"grunt-contrib-copy": "^0.5.0",
22-
"grunt-contrib-compress": "^0.11.0",
23+
"grunt-contrib-watch": "~0.6.1",
2324
"grunt-gh-pages": "^0.9.1",
25+
"grunt-github-releaser": "^0.1.17",
2426
"grunt-newer": "^0.7.0",
27+
"grunt-prompt": "^1.3.0",
2528
"load-grunt-tasks": "~0.6.0",
26-
"minimist": "~1.1.0",
27-
"grunt-concurrent": "^0.5.0",
28-
"grunt-github-releaser": "^0.1.17"
29+
"minimist": "~1.1.0"
2930
}
3031
}

0 commit comments

Comments
 (0)