2021-05-12 03:01:52 +02:00
let versionRegex = /(\nversion:\s)([0-9.-]+)/ ;
let velocityVersionRegex = /(\sversion\s=\s")([0-9.-]+)("\))/ ;
2021-05-12 02:19:01 +02:00
2021-05-12 03:52:43 +02:00
const ymlUpdater = {
updater : {
'readVersion' : ( contents ) => {
return versionRegex . exec ( contents ) [ 2 ] ;
} ,
'writeVersion' : ( contents , version ) => {
return contents . replace ( versionRegex , ` $ 1 ${ version } ` ) ;
}
}
}
2021-05-12 02:19:01 +02:00
2021-05-12 03:52:43 +02:00
const bungee = {
filename : 'src/main/resources/bungee.yml' ,
... ymlUpdater ,
}
const plugin = {
filename : 'src/main/resources/plugin.yml' ,
... ymlUpdater ,
}
2021-05-12 03:01:52 +02:00
const velocity _plugin = {
filename : 'src/main/java/com/sekwah/advancedportals/velocity/AdvancedPortalsPlugin.java' ,
updater : {
'readVersion' : ( contents ) => {
return velocityVersionRegex . exec ( contents ) [ 2 ] ;
} ,
'writeVersion' : ( contents , version ) => {
return contents . replace ( velocityVersionRegex , ` $ 1 ${ version } $ 3 ` ) ;
}
}
}
2021-05-12 03:52:43 +02:00
const files = [ plugin , velocity _plugin , bungee ] ;
2021-05-12 02:19:01 +02:00
module . exports = {
2021-05-12 03:52:43 +02:00
bumpFiles : files ,
2021-05-14 03:10:38 +02:00
packageFiles : files ,
2021-05-18 04:39:06 +02:00
// In case you need to force a version change (mostly due to change of scope of the update e.g. major now instead of patch)
2021-05-15 03:59:07 +02:00
//releaseAs: '0.16.0',
2021-05-14 03:10:38 +02:00
header : "# Changelog\n" +
"\n" +
"All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n" +
"\n" +
2021-05-14 03:32:48 +02:00
"For the release changelogs see [CHANGELOG.md](CHANGELOG.md) \n" +
"For the snapshot changelogs see [SNAPSHOT_CHANGELOG.md](SNAPSHOT_CHANGELOG.md)\n" ,
2021-05-12 02:19:01 +02:00
}