Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .autobumper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
const update_yml_version = (contents, previousVersion, releaseVersion) => {
return contents.replace(
/\nversion\:[\s]+[0-9]+(\.[0-9]+)+/g,
`\nversion: ${releaseVersion}`
);
};

const update_plugin_annotation = (contents, previousVersion, releaseVersion) => {
return contents.replace(
/version[\s]+=[\s]+"[0-9]+(\.[0-9]+)+"/g,
`version = "${releaseVersion}"`
);
};

const update_yml_quote_version = (contents, previousVersion, releaseVersion) => {
return contents.replace(
/\nversion\:[\s]+"[0-9]+(\.[0-9]+)+"/g,
`\nversion: "${releaseVersion}"`
);
};

const append_version = (contents, previousVersion, releaseVersion) => {
return contents.replace(
/ALLOWED_VERSIONS = new String\[\] {[\s]+/g,
`ALLOWED_VERSIONS = new String[] {\n\t\t\t"${releaseVersion}",\n\t\t\t`
);
};

const append_version_latest = (contents, previousVersion, releaseVersion) => {
return contents.replace(
/LATEST_VERSION = "[0-9]+(\.[0-9]+)+";/g,
`LATEST_VERSION = "${releaseVersion}";`
);
};

module.exports = {
bumpFiles: [
{
path: 'src/main/java/xyz/olivermartin/multichat/local/sponge/MultiChatLocalSpongePlugin.java',
task: update_plugin_annotation
},
{
path: 'src/main/java/xyz/olivermartin/multichat/bungee/MultiChat.java',
task: append_version
},
{
path: 'src/main/java/xyz/olivermartin/multichat/bungee/MultiChat.java',
task: append_version_latest
},
{
path: 'src/main/resources/bungee.yml',
task: update_yml_version
},
{
path: 'src/main/resources/plugin.yml',
task: update_yml_version
},
{
path: 'src/main/resources/chatcontrol_fr.yml',
task: update_yml_quote_version
},
{
path: 'src/main/resources/chatcontrol.yml',
task: update_yml_quote_version
},
{
path: 'src/main/resources/config_fr.yml',
task: update_yml_quote_version
},
{
path: 'src/main/resources/config.yml',
task: update_yml_quote_version
},
{
path: 'src/main/resources/joinmessages_fr.yml',
task: update_yml_quote_version
},
{
path: 'src/main/resources/joinmessages.yml',
task: update_yml_quote_version
},
{
path: 'src/main/resources/localconfig_fr.yml',
task: update_yml_quote_version
},
{
path: 'src/main/resources/localconfig.yml',
task: update_yml_quote_version
},
{
path: 'src/main/resources/messages_fr.yml',
task: update_yml_quote_version
},
{
path: 'src/main/resources/messages.yml',
task: update_yml_quote_version
}
]
};
1 change: 1 addition & 0 deletions .autorc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"conventional-commits",
"first-time-contributor",
"released",
["auto-plugin-auto-bumper", {"scripted":true}],
["maven", {"mavenReleaseGoals": ["package"]}],
["upload-assets", ["./target/multichat*.jar"]]
],
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
run: |
git fetch --unshallow --tags
yarn add -D auto
yarn add -D auto-plugin-auto-bumper
yarn add -D @auto-it/maven
yarn add -D @auto-it/all-contributors
yarn add -D @auto-it/conventional-commits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public class MultiChat extends Plugin implements Listener {
public static final String LATEST_VERSION = "1.9.6";

public static final String[] ALLOWED_VERSIONS = new String[] {

LATEST_VERSION,
"1.9.6",
"1.9.5",
"1.9.4",
"1.9.3",
Expand Down