bentobox/.github/workflows/build.yml

45 lines
1.4 KiB
YAML
Raw Normal View History

2020-11-09 00:26:11 +01:00
name: Build
on:
push:
branches:
- develop
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 16
Version 1.17.1 (#1796) * Version 1.17.1 * Add homes command to default player options. * Implements better online player counter. (#1791) Current one is based on online player count when bStats sends data to the server. This one will send data about amount of players who logged in the server. * Add Boxed Gamemode to the list. (#1793) * Add Bank addon (#1792) * Add Holographic Displays as SoftDepend for AOneBlock (#1794) * Custom date time format support for /<admin> info <player> (#1783) Fixes #1720 * Parent/sub-flag support, split up and designate CONTAINER flag as parent flag (#1784) * Split CONTAINER flag into multiple flags CONTAINER split into - CONTAINER (Chest/Minecart Chest) - BARREL (Barrel) - COMPOSTER (Composter) - FLOWER_POT (Flower Pot) - SHULKER_BOX (Shulker Box) - TRAPPED_CHEST (Trapped Chest) Fixes #1777 * Add subflag support * Create container parent flag, chest subflag * Remove extra string from when CHEST was CONTAINER * Fix incorrect flag specified on fired event in IslandToggleClick * Add missing world subflag event firing * Remove extra import * Add world setting flag for island visitors keep inventory (#1785) * Implement 3 bar charts: addons, gamemodes, hooks (#1790) BStats supports sending Bar chart data, however, it does not display it via their site directly. It can be called manually, to view. PieChart does not work very well for addons and hooks. BarChart however allows viewing each addon separately. This change allows sending data to the server about bar charts. * Update action versions * Declare distribution - adopt * Cache Java Maven files differently. * Try dependency for shade snapshot * Add support for Minecraft 1.17.1 * Fix test by incrementing listener value check There is a new listener now. * Spigot 1.17.1 * Fix test for InventoryListener * Re-order repos. * Downgrading to 1.17 Spigot for now to enable building. * Try pluginRespositories tag in POM to enable Github actions Co-authored-by: BONNe <bonne@bonne.id.lv> Co-authored-by: Fredthedoggy <45927799+Fredthedoggy@users.noreply.github.com> Co-authored-by: Justin <jstnf@users.noreply.github.com>
2021-07-11 03:27:57 +02:00
uses: actions/setup-java@v2
2020-11-09 00:26:11 +01:00
with:
Version 1.17.1 (#1796) * Version 1.17.1 * Add homes command to default player options. * Implements better online player counter. (#1791) Current one is based on online player count when bStats sends data to the server. This one will send data about amount of players who logged in the server. * Add Boxed Gamemode to the list. (#1793) * Add Bank addon (#1792) * Add Holographic Displays as SoftDepend for AOneBlock (#1794) * Custom date time format support for /<admin> info <player> (#1783) Fixes #1720 * Parent/sub-flag support, split up and designate CONTAINER flag as parent flag (#1784) * Split CONTAINER flag into multiple flags CONTAINER split into - CONTAINER (Chest/Minecart Chest) - BARREL (Barrel) - COMPOSTER (Composter) - FLOWER_POT (Flower Pot) - SHULKER_BOX (Shulker Box) - TRAPPED_CHEST (Trapped Chest) Fixes #1777 * Add subflag support * Create container parent flag, chest subflag * Remove extra string from when CHEST was CONTAINER * Fix incorrect flag specified on fired event in IslandToggleClick * Add missing world subflag event firing * Remove extra import * Add world setting flag for island visitors keep inventory (#1785) * Implement 3 bar charts: addons, gamemodes, hooks (#1790) BStats supports sending Bar chart data, however, it does not display it via their site directly. It can be called manually, to view. PieChart does not work very well for addons and hooks. BarChart however allows viewing each addon separately. This change allows sending data to the server about bar charts. * Update action versions * Declare distribution - adopt * Cache Java Maven files differently. * Try dependency for shade snapshot * Add support for Minecraft 1.17.1 * Fix test by incrementing listener value check There is a new listener now. * Spigot 1.17.1 * Fix test for InventoryListener * Re-order repos. * Downgrading to 1.17 Spigot for now to enable building. * Try pluginRespositories tag in POM to enable Github actions Co-authored-by: BONNe <bonne@bonne.id.lv> Co-authored-by: Fredthedoggy <45927799+Fredthedoggy@users.noreply.github.com> Co-authored-by: Justin <jstnf@users.noreply.github.com>
2021-07-11 03:27:57 +02:00
distribution: 'adopt'
java-version: '16'
2020-11-09 00:26:11 +01:00
- name: Cache SonarCloud packages
Version 1.17.1 (#1796) * Version 1.17.1 * Add homes command to default player options. * Implements better online player counter. (#1791) Current one is based on online player count when bStats sends data to the server. This one will send data about amount of players who logged in the server. * Add Boxed Gamemode to the list. (#1793) * Add Bank addon (#1792) * Add Holographic Displays as SoftDepend for AOneBlock (#1794) * Custom date time format support for /<admin> info <player> (#1783) Fixes #1720 * Parent/sub-flag support, split up and designate CONTAINER flag as parent flag (#1784) * Split CONTAINER flag into multiple flags CONTAINER split into - CONTAINER (Chest/Minecart Chest) - BARREL (Barrel) - COMPOSTER (Composter) - FLOWER_POT (Flower Pot) - SHULKER_BOX (Shulker Box) - TRAPPED_CHEST (Trapped Chest) Fixes #1777 * Add subflag support * Create container parent flag, chest subflag * Remove extra string from when CHEST was CONTAINER * Fix incorrect flag specified on fired event in IslandToggleClick * Add missing world subflag event firing * Remove extra import * Add world setting flag for island visitors keep inventory (#1785) * Implement 3 bar charts: addons, gamemodes, hooks (#1790) BStats supports sending Bar chart data, however, it does not display it via their site directly. It can be called manually, to view. PieChart does not work very well for addons and hooks. BarChart however allows viewing each addon separately. This change allows sending data to the server about bar charts. * Update action versions * Declare distribution - adopt * Cache Java Maven files differently. * Try dependency for shade snapshot * Add support for Minecraft 1.17.1 * Fix test by incrementing listener value check There is a new listener now. * Spigot 1.17.1 * Fix test for InventoryListener * Re-order repos. * Downgrading to 1.17 Spigot for now to enable building. * Try pluginRespositories tag in POM to enable Github actions Co-authored-by: BONNe <bonne@bonne.id.lv> Co-authored-by: Fredthedoggy <45927799+Fredthedoggy@users.noreply.github.com> Co-authored-by: Justin <jstnf@users.noreply.github.com>
2021-07-11 03:27:57 +02:00
uses: actions/cache@v2
2020-11-09 00:26:11 +01:00
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
Release 1.18.0 (#1876) ## Change Log * Island range perms could be 2x island distance This could allow protection ranges to be much greater than the island range and therefore overflow into adjacent islands. https://github.com/BentoBoxWorld/BentoBox/issues/1851 * Ensure maxEverProtectionRange is less than range. https://github.com/BentoBoxWorld/BentoBox/issues/1851 * Added test class for Island. * Added access to private fields for JUnit tests * Added Sonar Properties to POM * Changes to analyze using sonar. * Remove zip reference * Avoid zipSlip vulnerability. * Removed the unused WorldEdit hook. (#1853) If someone wants to add it back later they can, but this code does nothing right now. * Requires nonNull parameters for User.instanceOf (#1852) * Requires nonNull parameters for User.instanceOf The only reason why User.instanceOf was returning a potential null was if the parameter was null. Further absolutely no null checking was being done, so the assumption was that User.instanceOf should never return a null. This corrects the annotations and requires non-Null parameters. * Remove null player test * Fix JavaDoc for GameModeAddon inWorld method * Fix max-range bug * Remove illegal tag as it's not needed * Code smell reduction * Add missing packages so tests can pass. * Non null user methods (#1856) * This makes some User methods non-null. Instead of returning null, some methods will throw an error if they are called on non-Players. This means code does not have to do null checks. * Perform null check in method. * Null check * Fix test * Fix test. * Npe squashing (#1857) * Fix hanging [uuid] in info. * NPE checking * Make getProtectionCenter nonNull * More NPE fixes. * Fix test * Make getPlayer() and getOfflinePlayer() nonNull returns This requires addons to not use null checks and instead us the isPlayer or isOfflinePlayer methods. * NPE blockers * Deprecate CompositeCommand isPlayer method. * Fix test * Use isPlayer instead of null check. Refactor code to be easier to understand. * Fix * Fix some code smells. * Prevent NPE possibility. * Fix "ugly" enchant name. (#1858) Enchant names did not have a touch of Util#prettifyText code. * Remove deprecated events. * Fix IslandSethomeCommand test * Fix tests - just counts of events. * Added API to get a translation without color conversion It may be necessary to read the translation without converting colors to Bukkit colors. * Fix tests. * Fix test. * Version NPE protections. * 1.18.0 (#1860) * Mark all home-related methods in PlayersManager as deprecated. * Fix bug where maxHomes was shown as null * Version 1.18.0 API changes may break compatibility with Addons. * Remove usage of deprecated methods except for migration code. * Prevent NPE. Check isPlayer instead of getWorld() == null * Fix nullability issue and added to @Deprecated annotations * Added deprecation notices to home methods in Players * Fix missing color conversion for translations. * Fix mis-statement of island protection coordinates in info command. * Fix tests * Fix missing edge deletion of island. The bounding box was erroneously being made smaller when it was not required because the inBounds check does that already. https://github.com/BentoBoxWorld/BentoBox/issues/1863 * Prevent rare NPE * Ensure oldIsland is never null. * Refactored setowner command and added test class * API: Require getWorldSettings to be a game mode world * Fix tests and refactor code * Fix test IWM inWworld needs to return true * Fix test IWM inWorld must return true * Put default getHandlers back in for backwards compatibility Without them, too many older addons break. They need updating to have their own handlers. Once that is done, the default ones can be removed maybe. * Refactor code for clarity. * NPE protections * Prevent NPE @Poslovich - you were right! * Throw an error if player is null * Prevent NPE * Prevent NPE * Do a null check * World should never be null. * Require non-null world * Require owner to be non-null. It should never be null * Prevent NPEs * Clear the going home flag for edge cases There were a few potential times when the flag may not have been cleared. These were mostly teleport failure scenarios. Hopefully, this is all of them. https://github.com/BentoBoxWorld/BentoBox/issues/1864 * Shift priority of EntityPortalEnterEvent to HIGH https://github.com/BentoBoxWorld/BentoBox/issues/1866 This will allow other plugins running at NORMAL to cancel the event before BentoBox does something. * Increase priority of EntityPortalEvent listener https://github.com/BentoBoxWorld/BentoBox/issues/1866 * Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1868 * Code refactoring around User.getInstance(player) Co-authored-by: BONNe <bonne@bonne.id.lv> Co-authored-by: Fredthedoggy <45927799+Fredthedoggy@users.noreply.github.com> Co-authored-by: Justin <jstnf@users.noreply.github.com> Co-authored-by: gecko10000 <60494179+levtey@users.noreply.github.com>
2021-11-09 06:28:12 +01:00
- name: Cache Maven packages
Version 1.17.1 (#1796) * Version 1.17.1 * Add homes command to default player options. * Implements better online player counter. (#1791) Current one is based on online player count when bStats sends data to the server. This one will send data about amount of players who logged in the server. * Add Boxed Gamemode to the list. (#1793) * Add Bank addon (#1792) * Add Holographic Displays as SoftDepend for AOneBlock (#1794) * Custom date time format support for /<admin> info <player> (#1783) Fixes #1720 * Parent/sub-flag support, split up and designate CONTAINER flag as parent flag (#1784) * Split CONTAINER flag into multiple flags CONTAINER split into - CONTAINER (Chest/Minecart Chest) - BARREL (Barrel) - COMPOSTER (Composter) - FLOWER_POT (Flower Pot) - SHULKER_BOX (Shulker Box) - TRAPPED_CHEST (Trapped Chest) Fixes #1777 * Add subflag support * Create container parent flag, chest subflag * Remove extra string from when CHEST was CONTAINER * Fix incorrect flag specified on fired event in IslandToggleClick * Add missing world subflag event firing * Remove extra import * Add world setting flag for island visitors keep inventory (#1785) * Implement 3 bar charts: addons, gamemodes, hooks (#1790) BStats supports sending Bar chart data, however, it does not display it via their site directly. It can be called manually, to view. PieChart does not work very well for addons and hooks. BarChart however allows viewing each addon separately. This change allows sending data to the server about bar charts. * Update action versions * Declare distribution - adopt * Cache Java Maven files differently. * Try dependency for shade snapshot * Add support for Minecraft 1.17.1 * Fix test by incrementing listener value check There is a new listener now. * Spigot 1.17.1 * Fix test for InventoryListener * Re-order repos. * Downgrading to 1.17 Spigot for now to enable building. * Try pluginRespositories tag in POM to enable Github actions Co-authored-by: BONNe <bonne@bonne.id.lv> Co-authored-by: Fredthedoggy <45927799+Fredthedoggy@users.noreply.github.com> Co-authored-by: Justin <jstnf@users.noreply.github.com>
2021-07-11 03:27:57 +02:00
uses: actions/cache@v2
2020-11-09 00:26:11 +01:00
with:
Release 1.18.0 (#1876) ## Change Log * Island range perms could be 2x island distance This could allow protection ranges to be much greater than the island range and therefore overflow into adjacent islands. https://github.com/BentoBoxWorld/BentoBox/issues/1851 * Ensure maxEverProtectionRange is less than range. https://github.com/BentoBoxWorld/BentoBox/issues/1851 * Added test class for Island. * Added access to private fields for JUnit tests * Added Sonar Properties to POM * Changes to analyze using sonar. * Remove zip reference * Avoid zipSlip vulnerability. * Removed the unused WorldEdit hook. (#1853) If someone wants to add it back later they can, but this code does nothing right now. * Requires nonNull parameters for User.instanceOf (#1852) * Requires nonNull parameters for User.instanceOf The only reason why User.instanceOf was returning a potential null was if the parameter was null. Further absolutely no null checking was being done, so the assumption was that User.instanceOf should never return a null. This corrects the annotations and requires non-Null parameters. * Remove null player test * Fix JavaDoc for GameModeAddon inWorld method * Fix max-range bug * Remove illegal tag as it's not needed * Code smell reduction * Add missing packages so tests can pass. * Non null user methods (#1856) * This makes some User methods non-null. Instead of returning null, some methods will throw an error if they are called on non-Players. This means code does not have to do null checks. * Perform null check in method. * Null check * Fix test * Fix test. * Npe squashing (#1857) * Fix hanging [uuid] in info. * NPE checking * Make getProtectionCenter nonNull * More NPE fixes. * Fix test * Make getPlayer() and getOfflinePlayer() nonNull returns This requires addons to not use null checks and instead us the isPlayer or isOfflinePlayer methods. * NPE blockers * Deprecate CompositeCommand isPlayer method. * Fix test * Use isPlayer instead of null check. Refactor code to be easier to understand. * Fix * Fix some code smells. * Prevent NPE possibility. * Fix "ugly" enchant name. (#1858) Enchant names did not have a touch of Util#prettifyText code. * Remove deprecated events. * Fix IslandSethomeCommand test * Fix tests - just counts of events. * Added API to get a translation without color conversion It may be necessary to read the translation without converting colors to Bukkit colors. * Fix tests. * Fix test. * Version NPE protections. * 1.18.0 (#1860) * Mark all home-related methods in PlayersManager as deprecated. * Fix bug where maxHomes was shown as null * Version 1.18.0 API changes may break compatibility with Addons. * Remove usage of deprecated methods except for migration code. * Prevent NPE. Check isPlayer instead of getWorld() == null * Fix nullability issue and added to @Deprecated annotations * Added deprecation notices to home methods in Players * Fix missing color conversion for translations. * Fix mis-statement of island protection coordinates in info command. * Fix tests * Fix missing edge deletion of island. The bounding box was erroneously being made smaller when it was not required because the inBounds check does that already. https://github.com/BentoBoxWorld/BentoBox/issues/1863 * Prevent rare NPE * Ensure oldIsland is never null. * Refactored setowner command and added test class * API: Require getWorldSettings to be a game mode world * Fix tests and refactor code * Fix test IWM inWworld needs to return true * Fix test IWM inWorld must return true * Put default getHandlers back in for backwards compatibility Without them, too many older addons break. They need updating to have their own handlers. Once that is done, the default ones can be removed maybe. * Refactor code for clarity. * NPE protections * Prevent NPE @Poslovich - you were right! * Throw an error if player is null * Prevent NPE * Prevent NPE * Do a null check * World should never be null. * Require non-null world * Require owner to be non-null. It should never be null * Prevent NPEs * Clear the going home flag for edge cases There were a few potential times when the flag may not have been cleared. These were mostly teleport failure scenarios. Hopefully, this is all of them. https://github.com/BentoBoxWorld/BentoBox/issues/1864 * Shift priority of EntityPortalEnterEvent to HIGH https://github.com/BentoBoxWorld/BentoBox/issues/1866 This will allow other plugins running at NORMAL to cancel the event before BentoBox does something. * Increase priority of EntityPortalEvent listener https://github.com/BentoBoxWorld/BentoBox/issues/1866 * Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1868 * Code refactoring around User.getInstance(player) Co-authored-by: BONNe <bonne@bonne.id.lv> Co-authored-by: Fredthedoggy <45927799+Fredthedoggy@users.noreply.github.com> Co-authored-by: Justin <jstnf@users.noreply.github.com> Co-authored-by: gecko10000 <60494179+levtey@users.noreply.github.com>
2021-11-09 06:28:12 +01:00
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=BentoBoxWorld_BentoBox
- run: mvn --batch-mode clean org.jacoco:jacoco-maven-plugin:prepare-agent install
2020-11-09 00:26:11 +01:00
- run: mkdir staging && cp target/*.jar staging
- name: Save artifacts
uses: actions/upload-artifact@v2
with:
name: Package
2020-11-09 00:35:38 +01:00
path: staging