ci: Fixed version bumping

This commit is contained in:
Sekwah 2021-05-12 02:01:52 +01:00
parent fd6ef9ac08
commit 4278cd5d7a
No known key found for this signature in database
GPG Key ID: C3BE2E6C861A461A
2 changed files with 19 additions and 7 deletions

View File

@ -1,7 +1,8 @@
let versionRegex = /(\nversion=)([0-9.-]+)/;
let versionRegex = /(\nversion:\s)([0-9.-]+)/;
let velocityVersionRegex = /(\sversion\s=\s")([0-9.-]+)("\))/;
const tracker = {
filename: 'gradle.properties',
const plugin = {
filename: 'src/main/resources/plugin.yml',
updater: {
'readVersion': (contents) => {
return versionRegex.exec(contents)[2];
@ -12,7 +13,19 @@ const tracker = {
}
}
module.exports = {
bumpFiles: [tracker],
packageFiles: [tracker]
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`);
}
}
}
module.exports = {
bumpFiles: [plugin, velocity_plugin],
packageFiles: [plugin, velocity_plugin]
}

View File

@ -12,7 +12,6 @@ import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.ServerConnection;
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier;
import org.slf4j.Logger;