From e8cbb403c5237fa4ffb61d5ccc6b50b0f461324e Mon Sep 17 00:00:00 2001 From: Sekwah Date: Wed, 12 May 2021 02:52:43 +0100 Subject: [PATCH] ci: Fix issue with wrong dev mode --- .versionrc.js | 27 +++++++++++++++++-- build.gradle | 2 +- .../velocity/AdvancedPortalsPlugin.java | 2 +- src/main/resources/bungee.yml | 2 +- src/main/resources/plugin.yml | 2 +- 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.versionrc.js b/.versionrc.js index 84bf848..ad1f0ae 100644 --- a/.versionrc.js +++ b/.versionrc.js @@ -1,6 +1,17 @@ let versionRegex = /(\nversion:\s)([0-9.-]+)/; let velocityVersionRegex = /(\sversion\s=\s")([0-9.-]+)("\))/; + +const ymlUpdater = { + updater: { + 'readVersion': (contents) => { + return versionRegex.exec(contents)[2]; + }, + 'writeVersion': (contents, version) => { + return contents.replace(versionRegex, `$1${version}`); + } + } +} const plugin = { filename: 'src/main/resources/plugin.yml', updater: { @@ -13,6 +24,16 @@ const plugin = { } } +const bungee = { + filename: 'src/main/resources/bungee.yml', + ...ymlUpdater, +} + +const plugin = { + filename: 'src/main/resources/plugin.yml', + ...ymlUpdater, +} + const velocity_plugin = { filename: 'src/main/java/com/sekwah/advancedportals/velocity/AdvancedPortalsPlugin.java', updater: { @@ -25,7 +46,9 @@ const velocity_plugin = { } } +const files = [plugin, velocity_plugin, bungee]; + module.exports = { - bumpFiles: [plugin, velocity_plugin], - packageFiles: [plugin, velocity_plugin] + bumpFiles: files, + packageFiles: files } diff --git a/build.gradle b/build.gradle index 9117f79..33bfaf3 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ apply plugin: 'eclipse' def branch = System.getenv("GITHUB_REF"); def sha = System.getenv("GITHUB_SHA"); -def isDevBranch = branch == null || !(branch.startsWith("refs/tags/") && branch.contains("-")) +def isDevBranch = branch == null || !(branch.startsWith("refs/tags/") && !branch.contains("-")) group = 'com.sekwah.advancedportals' version = getPluginData("version") + (isDevBranch ? '-SNAPSHOT' : '') diff --git a/src/main/java/com/sekwah/advancedportals/velocity/AdvancedPortalsPlugin.java b/src/main/java/com/sekwah/advancedportals/velocity/AdvancedPortalsPlugin.java index 553702c..706f20d 100644 --- a/src/main/java/com/sekwah/advancedportals/velocity/AdvancedPortalsPlugin.java +++ b/src/main/java/com/sekwah/advancedportals/velocity/AdvancedPortalsPlugin.java @@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit; */ @Plugin(id = "advancedportals", name = "Advanced Portals", url = "https://www.spigotmc.org/resources/advanced-portals.14356/", - version = "0.5.14-0") + version = "0.5.13-0") public class AdvancedPortalsPlugin { public HashMap PlayerDestiMap = new HashMap<>(); diff --git a/src/main/resources/bungee.yml b/src/main/resources/bungee.yml index 7c4275c..3557274 100644 --- a/src/main/resources/bungee.yml +++ b/src/main/resources/bungee.yml @@ -1,4 +1,4 @@ main: com.sekwah.advancedportals.bungee.AdvancedPortalsPlugin name: AdvancedPortals -version: 0.5.13 +version: 0.5.13-0 author: sekwah41 diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index c826fd3..07c6038 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ main: com.sekwah.advancedportals.bukkit.AdvancedPortalsPlugin name: AdvancedPortals -version: 0.5.14-0 +version: 0.5.13-0 author: sekwah41 description: An advanced portals plugin for bukkit. api-version: 1.13