Skip to content

Commit

Permalink
Build: Put version in file names instead of the parent directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mgol committed May 10, 2020
1 parent 6041d2d commit 4ba7bed
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions build/release.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,45 @@
"use strict";

module.exports = function( Release ) {
var
files = [
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: "dist",
cdnPublish: cdnFolder,

changelogShell: function() {
return "# Changelog for jQuery Color v" + Release.newVersion + "\n";
},

/**
* Generates any release artifacts that should be included in the release.
Expand All @@ -24,7 +49,12 @@ module.exports = function( Release ) {
*/
generateArtifacts: function( callback ) {
Release.exec( "grunt", "Grunt command failed" );
callback( files );
makeReleaseCopies( Release );
callback( distFiles );
}
} );
};

module.exports.dependencies = [
"[email protected]"
];

0 comments on commit 4ba7bed

Please sign in to comment.