chore: configuration file and script for versioning

See https://github.com/conventional-changelog/standard-version
pull/296/head
Francis Lachapelle 2021-03-26 09:49:12 -04:00
parent a95964b51f
commit 46948f514a
2 changed files with 37 additions and 0 deletions

27
.versionrc.js 100644
View File

@ -0,0 +1,27 @@
const tracker = {
filename: "Version",
updater: require("./Scripts/standard-version-updater.js")
}
module.exports = {
tagPrefix: "SOGo-",
issueUrlFormat: "https://sogo.nu/bugs/view.php?id={{id}}",
compareUrlFormat: "{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}",
types: [
{type: "feat", section: "Features"},
{type: "refactor", section: "Enhancements"},
{type: "perf", section: "Enhancements"},
{type: "i18n", section: "Localization"},
{type: "fix", section: "Bug Fixes"},
{type: "chore", hidden: true},
{type: "docs", hidden: true},
{type: "style", hidden: true},
{type: "test", hidden: true}
],
skip: {
commit: true,
tag: true
},
packageFiles: [tracker],
bumpFiles: [tracker]
}

View File

@ -0,0 +1,10 @@
module.exports.readVersion = function (contents) {
// console.debug('readVersion = ' + contents.match(/([0-9]+)/mg).join('.'));
return contents.match(/([0-9]+)/mg).join('.');
};
module.exports.writeVersion = function (contents, version) {
// console.debug('writeVersion = ' + version);
const versions = version.split('.');
return "MAJOR_VERSION=" + versions[0] + "\nMINOR_VERSION=" + versions[1] + "\nSUBMINOR_VERSION=" + versions[2];
};