From bd8dfbcc83bfe00bd6f0a13138ed751fdf274bd7 Mon Sep 17 00:00:00 2001 From: Martin Sulikowski Date: Wed, 19 Aug 2026 18:09:26 +0200 Subject: [PATCH] Improve CI, GitHub metadata, README --- .github/CODEOWNERS | 3 +- .github/CONTRIBUTING.md | 72 ++++++++----------- .github/ISSUE_TEMPLATE/bug-report.yml | 70 ++++-------------- .github/ISSUE_TEMPLATE/feature-request.yml | 30 ++------ .github/PULL_REQUEST_TEMPLATE.md | 36 ++-------- .github/SECURITY.md | 17 +++++ .github/workflows/gradle.yml | 27 +++---- .github/workflows/hangar-publish.yml | 8 ++- .github/workflows/modrinth-publish.yml | 8 ++- .github/workflows/publish.yml | 22 ++++-- README.md | 18 +++-- .../eternalcombat-java-unit-test.gradle.kts | 1 + eternalcombat-plugin/build.gradle.kts | 1 + 13 files changed, 123 insertions(+), 190 deletions(-) create mode 100644 .github/SECURITY.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2ff3e9b7..754689a9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1 @@ -* @EternalCodeTeam/eternalcodeteam-maintainers -/.github/CODEOWNERS @EternalCodeTeam/eternalcodeteam-maintainers \ No newline at end of file +* @EternalCodeTeam/team-maintainer diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 2c325619..76ca8de6 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,64 +1,54 @@ # πŸ‘‹ Contributing to EternalCombat -First off, thanks for taking the time to contribute! πŸŽ‰ -We love user contributions and want to make it as easy as possible for you to get involved. +Thanks for taking the time to contribute! This page covers everything you need to get started. -## πŸ› οΈ Development Setup +## πŸ› οΈ Requirements -To start contributing, you'll need to set up your environment: +- **JDK 21** (the project targets Java 21) +- Git -1. **Java 21**: We use Java 21 for development. Ensure you have a JDK 21 installed. -2. **IDE**: We recommend [IntelliJ IDEA](https://www.jetbrains.com/idea/). -3. **Git**: Ensure you have Git installed. +The Gradle wrapper is committed, so you don't need Gradle installed. -### πŸ“₯ Getting the Code +## πŸ”¨ Building and testing ```bash -# Fork the repository on GitHub first! -# https://github.com/EternalCodeTeam/EternalCombat/fork -git clone https://github.com/YOUR-USERNAME/EternalCombat.git +git clone https://github.com/EternalCodeTeam/EternalCombat.git cd EternalCombat +./gradlew build ``` -### πŸ”¨ Building the Project +`./gradlew build` compiles both modules, runs the unit tests and produces the shaded plugin jar in +`eternalcombat-plugin/build/libs/`. -Run this command in your terminal: +To run only the tests: ```bash -./gradlew build +./gradlew test ``` -## 🀝 How to Contribute - -1. **Fork & Clone**: Fork the repo to your own account and clone it. -2. **Branch**: Create a new branch for your feature or fix. - ```bash - git checkout -b feat/my-awesome-feature - ``` -3. **Code**: Hack away! πŸ’» -4. **Test**: Run manual test by `runServer` to ensure you haven't broken anything. - ```bash - ./gradlew runServer - ``` -5. **Push**: Push your changes to your fork. -6. **Pull Request**: Open a PR against the `master` branch. - -## πŸ“ Code Style +To try your changes on a real server, start a Paper server with the plugin and its dependencies +already installed: -Make sure that your code adheres to the plugin's existing coding style. +```bash +./gradlew runServer +``` -## πŸ› Reporting Bugs +## πŸ“ Code style -If you find a bug, please use the **Bug Report** issue template. -- Check if the issue already exists. -- Provide a minimal reproduction if possible. -- Include logs and screenshots. +Formatting rules live in [`.editorconfig`](../.editorconfig) β€” 4 spaces, UTF-8, LF endings. +Enable EditorConfig support in your IDE and match the style of the surrounding code. -## πŸ’‘ Feature Requests +## πŸš€ Pull requests -Have an idea? Use the **Feature Request** issue template. -- Explain *why* this feature is useful. -- Describe how it should look or behave. +1. Fork the repository and create a branch off `master`. +2. Keep the change focused β€” one topic per pull request. +3. Add or update tests when you change behaviour that can be tested without a server. +4. Make sure `./gradlew build` passes before opening the PR. +5. Prefix the PR title with the type of change, for example + `feat:`, `fix:`, `chore:`, `docs:`, or `GH-` when it closes an issue. +6. Describe what you changed and why β€” the pull request template is intentionally short. ## πŸ“„ License -By contributing, you agree that your contributions will be licensed under the project's [License](../LICENSE). + +By contributing, you agree that your contributions will be licensed under the +[Apache License 2.0](../LICENSE). diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 2648eb35..7284ef84 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,20 +1,14 @@ name: πŸ› Bug Report -description: File a bug report to help us improve EternalCombat +description: Report something that is broken in EternalCombat title: "[Bug]: " labels: ["bug"] body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - Please ensure that you have searched the existing issues to see if this bug has already been reported. - - type: textarea id: description attributes: - label: Bug description - description: A clear and concise description of what the bug is. - placeholder: I was doing X and Y happened... + label: What happened? + description: What went wrong, and what did you expect instead? + placeholder: I was doing X and Y happened, but I expected Z. validations: required: true @@ -22,63 +16,25 @@ body: id: reproduction attributes: label: Steps to reproduce - description: Please provide a step-by-step guide to reproduce the issue. placeholder: | - 1. Launch the server - 2. Tag yourself using the '/combat tag' command - 3. See error - validations: - required: true - - - type: textarea - id: expected-behavior - attributes: - label: Expected behavior - description: A clear and concise description of what you expected to happen. - validations: - required: true - - - type: textarea - id: screenshots - attributes: - label: Screenshots/Video - description: If applicable, add screenshots or a video to help explain your problem. - - - type: dropdown - id: server-software - attributes: - label: Server Software - description: What server software are you using? - options: - - Paper - - Purpur - - Spigot - - Folia - - Other (please specify in logs) - validations: - required: true - - - type: input - id: minecraft-version - attributes: - label: Minecraft Version - description: What version of Minecraft are you running? (e.g. 1.21.11) - placeholder: 1.21.11 + 1. Start the server + 2. Run /combatlog tag + 3. See the error validations: required: true - type: input - id: plugin-version + id: versions attributes: - label: Plugin Version - description: What version of EternalCombat are you running? (Check with /eternalcombat version) - placeholder: v2.4.1 + label: Versions + description: Server software and version, plus the EternalCombat version. + placeholder: Paper 1.21.11, EternalCombat 2.5.1 validations: required: true - type: textarea id: logs attributes: - label: Logs / Stack Trace - description: Please paste any relevant logs or stack traces here. Use a pastebin service if the log is too long. + label: Logs + description: Any relevant errors or stack traces. Use a paste service for long logs. render: shell diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 0cdd4cba..7a630ee9 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -3,36 +3,16 @@ description: Suggest an idea for EternalCombat title: "[Feature]: " labels: ["feature"] body: - - type: markdown - attributes: - value: | - Thanks for suggesting a new feature! Please explain your idea in detail. - - - type: textarea - id: problem - attributes: - label: Is your feature request related to a problem? - description: Please describe the problem you are trying to solve. - placeholder: I'm always frustrated when... - validations: - required: true - - type: textarea - id: solution + id: idea attributes: - label: Describe the solution you'd like - description: A clear and concise description of what you want to happen. + label: What would you like to see? + description: Describe the feature and the problem it would solve. validations: required: true - type: textarea - id: alternatives - attributes: - label: Describe alternatives you've considered - description: A clear and concise description of any alternative solutions or features you've considered. - - - type: textarea - id: additional-context + id: context attributes: label: Additional context - description: Add any other context or screenshots about the feature request here. + description: Optional β€” alternatives you considered, examples, or screenshots. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2bfcc26e..2ec6f12f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,35 +1,11 @@ ---- -name: Pull Request -about: Submit a contribution to EternalCombat -title: 'GH-{NUMBER} ' -labels: [] -assignees: [] ---- +## What changed? -## πŸ“ Description -<!-- - Please submit your PR using the following title format: - feat: Description of the new feature - fix: Description of the bug fix - chore: Maintenance tasks - docs: Documentation changes ---> +<!-- A short description of the change. --> -<!-- Describe your changes clearly and concisely. Why is this change needed? What does it accomplish? --> +## Why? -## 🎯 Type of Change -<!-- Please check the boxes that apply to your changes --> -- [ ] πŸ› Bug fix (non-breaking change which fixes an issue) -- [ ] ✨ New feature (non-breaking change which adds functionality) -- [ ] πŸ’₯ Breaking change (fix or feature that would cause existing functionality to not work as expected) -- [ ] πŸ”§ Refactoring (no functional changes, just code improvements) -- [ ] 🎨 Style/Cosmetic (formatting, whitespace, visual changes) -- [ ] πŸ“š Documentation (updates to documentation or README) -- [ ] πŸ€– CI/CD/Build (changes to workflows, gradle, etc.) +<!-- The problem this solves, or the issue it closes (e.g. Closes #123). --> -**Test Environment:** -- **Minecraft Version:** <!-- e.g. 1.20.4 --> -- **Java Version:** <!-- e.g. 21 --> -- **Platform:** <!-- e.g. Windows/Linux/MacOS --> +## Anything else? -## πŸ“Έ Screenshots (if applicable) +<!-- Optional: how you tested it, screenshots, or notes for reviewers. --> diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 00000000..01da487d --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,17 @@ +# Security Policy + +## Supported versions + +Only the latest release of EternalCombat receives security fixes. +Please update before reporting an issue. + +## Reporting a vulnerability + +**Please do not open a public issue for security problems.** + +Report them privately to the maintainers on our +[Discord server](https://discord.com/invite/FQ7jmGBd6c) β€” open a ticket or send a +direct message to a team member. + +Include the plugin version, your server software and version, and the steps needed to +reproduce the problem. We will confirm the report and let you know once a fix is released. diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 39c92c37..59143ac8 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -5,9 +5,12 @@ on: branches: [ "master" ] pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: - runs-on: ubuntu-latest permissions: contents: read @@ -15,34 +18,24 @@ jobs: - name: Checkout uses: actions/checkout@v7 with: + # The build derives the snapshot version from `git describe --tags`. fetch-depth: 0 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v5 with: - java-version: '17' + java-version: '21' distribution: 'temurin' - name: Setup Gradle uses: gradle/actions/setup-gradle@v6 - - name: Set Variables & Build - uses: actions/github-script@v9 - with: - script: | - const isPR = context.eventName === 'pull_request'; - const branch = isPR ? context.payload.pull_request.head.ref.replace(/\//g, '-') : 'master'; - const sha = (isPR ? context.payload.pull_request.head.sha : context.sha).substring(0, 7); - - const artifactName = `EternalCombat ${branch}+${sha}`; - core.exportVariable('FULL_ARTIFACT_NAME', artifactName); - - name: Build with Gradle - run: ./gradlew shadowJar + run: ./gradlew build - name: Upload build artifact uses: actions/upload-artifact@v7 with: - name: ${{ env.FULL_ARTIFACT_NAME }} - path: eternalcombat-plugin/build/libs/*.jar + path: eternalcombat-plugin/build/libs/EternalCombat*.jar + if-no-files-found: error archive: false diff --git a/.github/workflows/hangar-publish.yml b/.github/workflows/hangar-publish.yml index 6ca177e3..dfbc9713 100644 --- a/.github/workflows/hangar-publish.yml +++ b/.github/workflows/hangar-publish.yml @@ -7,6 +7,10 @@ on: release: types: [published] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + jobs: publish: runs-on: ubuntu-latest @@ -22,10 +26,10 @@ jobs: with: java-version: '21' distribution: 'temurin' - + - name: Setup Gradle uses: gradle/actions/setup-gradle@v6 - + - name: Publish to Hangar run: ./gradlew :eternalcombat-plugin:publishPluginPublicationToHangar env: diff --git a/.github/workflows/modrinth-publish.yml b/.github/workflows/modrinth-publish.yml index 0a8be7fb..dfca6e47 100644 --- a/.github/workflows/modrinth-publish.yml +++ b/.github/workflows/modrinth-publish.yml @@ -7,6 +7,10 @@ on: release: types: [published] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + jobs: publish: runs-on: ubuntu-latest @@ -22,10 +26,10 @@ jobs: with: java-version: '21' distribution: 'temurin' - + - name: Setup Gradle uses: gradle/actions/setup-gradle@v6 - + - name: Publish to Modrinth run: ./gradlew :eternalcombat-plugin:modrinth env: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2efadbd4..c8c3e1ef 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,28 +1,36 @@ name: Publish EternalCombat API + on: release: - branches: [ master ] types: [ published ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + jobs: publish: runs-on: ubuntu-latest environment: deployment + permissions: + contents: read steps: - name: Checkout uses: actions/checkout@v7 + with: + fetch-depth: 0 - - name: Set up JDK + - name: Set up JDK 21 uses: actions/setup-java@v5 with: + java-version: '21' distribution: 'temurin' - java-version: 17 - cache: 'gradle' - - name: Grant execute permission for gradlew - run: chmod +x gradlew + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v6 - name: Publish with Gradle - run: ./gradlew clean build eternalcombat-api:publish + run: ./gradlew build :eternalcombat-api:publish env: ETERNAL_CODE_MAVEN_USERNAME: ${{ secrets.ETERNAL_CODE_MAVEN_USERNAME }} ETERNAL_CODE_MAVEN_PASSWORD: ${{ secrets.ETERNAL_CODE_MAVEN_PASSWORD }} diff --git a/README.md b/README.md index 283a7174..b629620c 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ [![Available on Modrinth](https://raw.githubusercontent.com/vLuckyyy/badges/main/avaiable-on-modrinth.svg)](https://modrinth.com/plugin/eternalcombat) [![Available on Hangar](https://raw.githubusercontent.com/vLuckyyy/badges/main/avaiable-on-hangar.svg)](https://hangar.papermc.io/EternalCodeTeam/eternalcombat) -[![Chat on Discord](https://raw.githubusercontent.com/vLuckyyy/badges/main//chat-with-us-on-discord.svg)](https://discord.com/invite/FQ7jmGBd6c) -[![Read the Docs](https://raw.githubusercontent.com/vLuckyyy/badges/main/read-the-documentation.svg)](https://docs.eternalcode.pl/eternalcombat/introduction) +[![Chat on Discord](https://raw.githubusercontent.com/vLuckyyy/badges/main/chat-with-us-on-discord.svg)](https://discord.com/invite/FQ7jmGBd6c) +[![Read the Docs](https://raw.githubusercontent.com/vLuckyyy/badges/main/read-the-documentation.svg)](https://eternalcode.pl/docs/eternalcombat/introduction) [![Available on BStats](https://raw.githubusercontent.com/vLuckyyy/badges/main/available-on-bstats.svg)](https://bstats.org/plugin/bukkit/EternalCombat/17803) [Report Bug](https://github.com/EternalCodeTeam/EternalCombat/issues) β€’ [Request Feature](https://github.com/EternalCodeTeam/EternalCombat/issues) β€’ [Join Discord](https://discord.com/invite/FQ7jmGBd6c) @@ -22,10 +22,10 @@ ### Information -## EternalCombat requires PacketEvents plugin to work. +#### EternalCombat requires PacketEvents plugin to work. You can download it from [here](https://modrinth.com/plugin/packetevents) -EternalCombat 2.0 has been tested on Minecraft versions **1.17.1 to 26.1.2**, but it should work seamlessly on most +EternalCombat 2.0 has been tested on Minecraft versions **1.19.3 to 26.1.2**, but it should work seamlessly on most other versions too. If you run into any compatibility issues, please let us know in the [Issues tab](https://github.com/EternalCodeTeam/EternalCombat/issues). @@ -91,9 +91,9 @@ Control who can use EternalCombat’s powerful features with these permissions: | `eternalcombat.stats` | View combat statistics with `/combatlog stats`. | | `eternalcombat.reload` | Reload the plugin with `/combatlog reload`. | | `eternalcombat.receiveupdates` | Receive notifications about new plugin versions on join. | -| `eternalcombat.bypass` | When exclude `excludeAdminsFromCombat` is set to `true` users with this permission will not be tagged | +| `eternalcombat.bypass` | When `excludeAdminsFromCombat` is set to `true`, users with this permission will not be tagged | -## PlaceholderAPI +### PlaceholderAPI EternalCombat 2.0 fully supports **PlaceholderAPI**, letting you integrate placeholders into other compatible plugins. Follow the [PlaceholderAPI instructions](https://wiki.placeholderapi.com/users/) to get started. @@ -163,8 +163,12 @@ details on how to get involved and our [code of conduct](https://github.com/Eter ### Reporting Issues Found a bug? -Report it in the [Issues tab](https://github.com/eternalcodeteam/eternalcombat/issues). +Report it in the [Issues tab](https://github.com/EternalCodeTeam/EternalCombat/issues). Please include as much detail as possible, like your Minecraft and plugin versions, along with any error messages or logs. Ready to transform your server’s combat experience? Download EternalCombat 2.0 now and let the battles begin! + +### License + +EternalCombat is licensed under the [Apache License 2.0](LICENSE). diff --git a/buildSrc/src/main/kotlin/eternalcombat-java-unit-test.gradle.kts b/buildSrc/src/main/kotlin/eternalcombat-java-unit-test.gradle.kts index 0ec46da2..db4da6c2 100644 --- a/buildSrc/src/main/kotlin/eternalcombat-java-unit-test.gradle.kts +++ b/buildSrc/src/main/kotlin/eternalcombat-java-unit-test.gradle.kts @@ -7,6 +7,7 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter-api:${Versions.JUNIT_JUPITER_API}") testImplementation("org.junit.jupiter:junit-jupiter-params:${Versions.JUNIT_JUPITER_PARAMS}") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${Versions.JUNIT_JUPITER_ENGINE}") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") } tasks.test { diff --git a/eternalcombat-plugin/build.gradle.kts b/eternalcombat-plugin/build.gradle.kts index 1b9e66aa..be3dd16e 100644 --- a/eternalcombat-plugin/build.gradle.kts +++ b/eternalcombat-plugin/build.gradle.kts @@ -8,6 +8,7 @@ plugins { `eternalcombat-publish-hangar` `eternalcombat-publish-modrinth` `eternalcombat-runserver` + `eternalcombat-java-unit-test` id("de.eldoria.plugin-yml.paper") version "0.9.0" id("com.gradleup.shadow")