Build server prototype (integration with GitHub / NuGet / etc)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
micro-build-server/BuildServer/lib/tasks/dotnetnugetpush.js

31 lines
1.1 KiB

"use strict";
const sequential = require("./sequential");
module.exports = (params, processor) => {
const date = new Date();
const version = (params.version || ((params.major || "0") + "." + (date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate()) + "." + ((date.getHours() * 100 + date.getMinutes()) * 100 + date.getSeconds()))) + (params.withoutCommitSha ? "" : ("-r" + processor.context.rev.substr(0, 16)));
const nupkg = params.name + "." + version + ".nupkg";
return sequential({
tasks: [
{
type: "dotnetbuilderwrapper",
params: {
command: "nugetpack",
BaseDirectory: processor.context.exported,
SpecPath: processor.context.exported + "/" + params.nuspec,
OutputDirectory: processor.context.exported,
Version: version
}
},
{
type: "dotnetnugetpushonly",
params: {
Package: nupkg
}
}
]
}, processor);
};