Skip to content
Permalink
Browse files

Automate release process

You can now use a grunt task to:
  - Publish a release to GitHub
  - Publish to npm
  - Publish to bower
  - Publish to NuGet

The command is:
  grunt publish

This will print a message warning you about what is about to happen and
showing you a checklist. Once you're sure you want to proceed, you run
this command:

  grunt publish:force

which actually publishes to all of the package managers.
  • Loading branch information...
rigdern committed Jul 30, 2015
1 parent dda39e6 commit 7ac5ea083bc638ff8620889a4cfe335617b13103
@@ -1,6 +1,8 @@
bin/
node_modules/
bld/
dist/
repos/

*.orig
*.suo
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>WinJS</id>
<version>1.0.0</version>
<title>Windows Library for JavaScript (WinJS)</title>
<authors>Microsoft Corporation and other contributors</authors>
<licenseUrl>https://github.com/winjs/winjs/blob/master/License.txt</licenseUrl>
<projectUrl>https://github.com/winjs/winjs</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>WinJS is a set of JavaScript toolkits that allow developers to build applications using HTML/JS/CSS technology.</description>
<copyright>Microsoft Corporation</copyright>
<tags>javascript</tags>
</metadata>
<files>
<file src="dist\winjs\npm\css\ui-dark.css" target="content\WinJS\css\ui-dark.css" />
<file src="dist\winjs\npm\css\ui-dark.min.css" target="content\WinJS\css\ui-dark.min.css" />
<file src="dist\winjs\npm\css\ui-light.css" target="content\WinJS\css\ui-light.css" />
<file src="dist\winjs\npm\css\ui-light.min.css" target="content\WinJS\css\ui-light.min.css" />
<file src="dist\winjs\npm\fonts\Symbols.ttf" target="content\WinJS\fonts\Symbols.ttf" />
<file src="dist\winjs\npm\js\en-US\ui.strings.js" target="content\WinJS\js\en-US\ui.strings.js" />
<file src="dist\winjs\npm\js\WinJS.intellisense-setup.js" target="content\WinJS\js\WinJS.intellisense-setup.js" />
<file src="dist\winjs\npm\js\WinJS.intellisense.js" target="content\WinJS\js\WinJS.intellisense.js" />
<file src="dist\winjs\npm\js\base.js" target="content\WinJS\js\base.js" />
<file src="dist\winjs\npm\js\base.min.js" target="content\WinJS\js\base.min.js" />
<file src="dist\winjs\npm\js\base.min.js.map" target="content\WinJS\js\base.min.js.map" />
<file src="dist\winjs\npm\js\ui.js" target="content\WinJS\js\ui.js" />
<file src="dist\winjs\npm\js\ui.min.js" target="content\WinJS\js\ui.min.js" />
<file src="dist\winjs\npm\js\ui.min.js.map" target="content\WinJS\js\ui.min.js.map" />
<file src="dist\winjs\npm\License.txt" target="content\WinJS\License.txt" />
<file src="dist\winjs\npm\README.md" target="content\WinJS\README.md" />
</files>
</package>
@@ -0,0 +1,13 @@
{
"name": "winjs",
"description": "WinJS is a set of JavaScript toolkits that allow developers to build applications using HTML/JS/CSS technology.",
"license": "MIT",
"homepage": "http://try.buildwinjs.com/",
"authors": [{
"name": "Microsoft Corporation and other contributors",
"homepage": "https://github.com/winjs/winjs/graphs/contributors"
}],
"main": ["js/ui.js", "css/ui-dark.css", "fonts/Symbols.ttf"],
"dependencies": {
}
}
@@ -24,6 +24,15 @@
config.desktopOutput = config.outputFolder + config.desktopFramework + "/";
config.compiledTsOutput = config.outputFolder + "tsbuild/";

config.reposRoot = 'repos/';
config.publishRoot = 'dist/';
config.winjsPublishRoot = config.publishRoot + 'winjs/';
config.winjsNpmPublishRoot = config.winjsPublishRoot + 'npm/';
config.winjsBowerRepo = config.reposRoot + 'winjs-bower/';
config.localizationPublishRoot = config.publishRoot + 'winjs-localization/';
config.localizationNpmPublishRoot = config.localizationPublishRoot + 'npm/';
config.localizationBowerRepo = config.reposRoot + 'winjs-localization-bower/';

config.stringsOutput = config.outputFolder + config.desktopFramework + "-strings/";

config.uiStringsFiles = [
@@ -44,5 +53,4 @@
"results": []
};


})();
@@ -26,6 +26,7 @@
"glob": "^4.0.5",
"grunt": "~0.4.5",
"grunt-contrib-clean": "~0.6.0",
"grunt-contrib-compress": "^0.13.0",
"grunt-contrib-concat": "~0.5.0",
"grunt-contrib-connect": "^0.8.0",
"grunt-contrib-copy": "~0.5.0",
@@ -34,7 +35,10 @@
"grunt-contrib-less": "~0.11.4",
"grunt-contrib-requirejs": "^0.4.4",
"grunt-contrib-uglify": "^0.5.1",
"grunt-git": "^0.3.5",
"grunt-github-releaser": "^0.1.17",
"grunt-jscs": "^1.8.0",
"grunt-nuget": "^0.1.4",
"grunt-replace": "~0.7.8",
"grunt-saucelabs": "git+https://github.com/xirzec/grunt-saucelabs.git#debug",
"grunt-shell": "~0.7.0",
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>WinJS-Localization</id>
<version>1.0.0</version>
<title>Localized strings for the Windows Library for JavaScript (WinJS)</title>
<authors>Microsoft Corporation and other contributors</authors>
<licenseUrl>https://github.com/winjs/winjs/blob/master/License.txt</licenseUrl>
<projectUrl>https://github.com/winjs/winjs</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Provides localized versions of each string used by WinJS for each language WinJS supports.</description>
<copyright>Microsoft Corporation</copyright>
<tags>javascript</tags>
</metadata>
<files>
<file src="..\..\dist\winjs-localization\npm\**\*.resjson" target="content\WinJS-Localization" />
<file src="..\..\dist\winjs-localization\npm\License.txt" target="content\WinJS-Localization\License.txt" />
<file src="..\..\dist\winjs-localization\npm\README.md" target="content\WinJS-Localization\README.md" />
</files>
</package>
@@ -0,0 +1,12 @@
{
"name": "winjs-localization",
"description": "Provides localized versions of each string used by WinJS for each language WinJS supports.",
"license": "MIT",
"homepage": "http://try.buildwinjs.com/",
"authors": [{
"name": "Microsoft Corporation and other contributors",
"homepage": "https://github.com/winjs/winjs/graphs/contributors"
}],
"dependencies": {
}
}
@@ -0,0 +1,22 @@
{
"name": "winjs-localization",
"title": "Localized strings for the Windows Library for JavaScript (WinJS)",
"description": "Provides localized versions of each string used by WinJS for each language WinJS supports.",
"version": "4.1.0",
"homepage": "http://try.buildwinjs.com/",
"author": {
"name": "Microsoft Corporation and other contributors",
"url": "https://github.com/winjs/winjs/graphs/contributors"
},
"repository": {
"type": "git",
"url": "https://github.com/winjs/winjs"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/winjs/winjs/blob/master/License.txt"
}
],
"bugs": "https://github.com/winjs/winjs/issues"
}
@@ -0,0 +1,24 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License.txt in the project root for license information.
(function () {
"use strict";

var exec = require('child_process').exec;

module.exports = function (grunt) {

grunt.registerTask('npm-release', 'Publishes a package to npm', function (mode) {
var done = this.async();
var src = grunt.option('src');

var cmd = 'npm publish ' + src;

exec(cmd, function (err, stdout) {
if (err) {
grunt.fatal('npm publish failed using command: ' + cmd);
}
done();
});
});
};

})();
@@ -20,6 +20,14 @@
],
strings: [
config.stringsOutput
],
publishWinJs: [
config.winjsPublishRoot,
config.winjsBowerRepo + '*'
],
publishLocalization: [
config.localizationPublishRoot,
config.localizationBowerRepo + '*'
]
};
})();
@@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License.txt in the project root for license information.
(function () {
"use strict";

var config = require("../../config.js");

module.exports = {
publishWinJs: {
options: {
archive: config.winjsPublishRoot + 'winjs.zip'
},
files: [{
expand: true,
cwd: config.winjsNpmPublishRoot,
src: ["**"]
}]
},
publishLocalization: {
options: {
archive: config.localizationPublishRoot + 'winjs-localization.zip'
},
files: [{
expand: true,
cwd: config.localizationNpmPublishRoot,
src: ["**"]
}]
}
};
})();
@@ -4,6 +4,82 @@

var config = require("../../config.js");
var path = require("path");

function genPublishWinJs(args) {
// required
var dest = args.dest;
// optional
var additionalFiles = args.additionalFiles || [];

return [{
// root
expand: true,
src: [
"README.md",
"License.txt",
].concat(additionalFiles),
dest: dest
}, {
// css
expand: true,
cwd: config.desktopOutput + "css",
src: [
"ui-dark.css",
"ui-dark.min.css",
"ui-light.css",
"ui-light.min.css"
],
dest: path.join(dest, "css")
}, {
// fonts
expand: true,
cwd: config.desktopOutput + "fonts",
src: ["Symbols.ttf"],
dest: path.join(dest, "fonts")
}, {
// js
expand: true,
cwd: config.desktopOutput + "js",
src: [
"base.js",
"base.min.js",
"base.min.js.map",
"ui.js",
"ui.min.js",
"ui.min.js.map",
"WinJS.intellisense-setup.js",
"WinJS.intellisense.js",
"en-US/ui.strings.js"
],
dest: path.join(dest, "js")
}];
}

function genPublishLocalization(args) {
// required
var dest = args.dest;
// optional
var additionalFiles = args.additionalFiles || [];

return [{
// WinJS src root
expand: true,
src: ["License.txt"],
dest: dest
}, {
// Localization src root
expand: true,
cwd: "src/strings/",
src: ["README.md"].concat(additionalFiles),
dest: dest
}, {
// Localization bin root
expand: true,
cwd: config.stringsOutput,
src: ["**"],
dest: dest
}];
}

module.exports = {
tests: {
@@ -60,5 +136,28 @@
dest: config.stringsOutput
}]
},

publishWinJs: {
files: []
.concat(genPublishWinJs({
additionalFiles: ["package.json"],
dest: config.winjsNpmPublishRoot
}))
.concat(genPublishWinJs({
additionalFiles: ["bower.json"],
dest: config.winjsBowerRepo
}))
},
publishLocalization: {
files: []
.concat(genPublishLocalization({
additionalFiles: ["package.json"],
dest: config.localizationNpmPublishRoot
}))
.concat(genPublishLocalization({
additionalFiles: ["bower.json"],
dest: config.localizationBowerRepo
}))
}
};
})();
@@ -0,0 +1,21 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License.txt in the project root for license information.
(function () {
"use strict";

var config = require("../../config.js");

module.exports = {
publishWinJsBower: {
options: {
cwd: config.winjsBowerRepo,
all: true
}
},
publishLocalizationBower: {
options: {
cwd: config.localizationBowerRepo,
all: true
}
}
};
})();
@@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License.txt in the project root for license information.
(function () {
"use strict";

var config = require("../../config.js");

module.exports = {

// git clean -f
// Remove files that are not tracked

publishWinJsBower: {
options: {
cwd: config.winjsBowerRepo,
force: true
}
},
publishLocalizationBower: {
options: {
cwd: config.localizationBowerRepo,
force: true
}
}
};
})();
Oops, something went wrong.

0 comments on commit 7ac5ea0

Please sign in to comment.
You can’t perform that action at this time.