forked from jquery/jquery-color
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.js
60 lines (52 loc) · 1.77 KB
/
release.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"use strict";
module.exports = function( Release ) {
var shell = require( "shelljs" ),
cdnFolder = "dist/cdn",
distFiles = [
"dist/jquery.color.js",
"dist/jquery.color.min.js",
"dist/jquery.color.plus-names.js",
"dist/jquery.color.plus-names.min.js",
"dist/jquery.color.svg-names.js",
"dist/jquery.color.svg-names.min.js"
],
releaseFiles = {
"[email protected]": "dist/jquery.color.js",
"[email protected]": "dist/jquery.color.min.js",
"[email protected]": "dist/jquery.color.plus-names.js",
"[email protected]": "dist/jquery.color.plus-names.min.js",
"[email protected]": "dist/jquery.color.svg-names.js",
"[email protected]": "dist/jquery.color.svg-names.min.js"
};
function makeReleaseCopies( Release ) {
shell.mkdir( "-p", cdnFolder );
Object.keys( releaseFiles ).forEach( function( key ) {
var builtFile = releaseFiles[ key ],
unpathedFile = key.replace( /@VERSION/g, Release.newVersion ),
releaseFile = cdnFolder + "/" + unpathedFile;
shell.cp( "-f", builtFile, releaseFile );
} );
}
Release.define( {
npmPublish: true,
issueTracker: "github",
cdnPublish: cdnFolder,
changelogShell: function() {
return "# Changelog for jQuery Color v" + Release.newVersion + "\n";
},
/**
* Generates any release artifacts that should be included in the release.
* The callback must be invoked with an array of files that should be
* committed before creating the tag.
* @param {Function} callback
*/
generateArtifacts: function( callback ) {
Release.exec( "grunt", "Grunt command failed" );
makeReleaseCopies( Release );
callback( distFiles );
}
} );
};
module.exports.dependencies = [
];