generated from xpdustry/template-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 81dc7b2
Showing
16 changed files
with
983 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ "**" ] | ||
tags-ignore: [ "**" ] | ||
pull_request: | ||
release: | ||
types: [ released, prereleased ] | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.event.number || github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
# Only run on PRs if the source branch is on someone else's repo | ||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Validate Gradle Wrapper | ||
uses: gradle/actions/wrapper-validation@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: 'temurin' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Build Artifact | ||
run: ./gradlew release | ||
|
||
- name: Upload Artifact to Actions | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: "${{ github.event.repository.name }}-artifacts" | ||
path: build/tmp/release/*.jar | ||
if-no-files-found: error | ||
|
||
- name: Determine Status | ||
run: | | ||
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then | ||
echo "STATUS=snapshot" >> $GITHUB_ENV | ||
else | ||
echo "STATUS=release" >> $GITHUB_ENV | ||
fi | ||
- name: Publish to Xpdustry | ||
if: ${{ env.STATUS == 'release' || startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/heads/dev') }} | ||
run: ./gradlew publish | ||
env: | ||
ORG_GRADLE_PROJECT_xpdustryUsername: "${{ secrets.XPDUSTRY_MAVEN_USERNAME }}" | ||
ORG_GRADLE_PROJECT_xpdustryPassword: "${{ secrets.XPDUSTRY_MAVEN_PASSWORD }}" | ||
ORG_GRADLE_PROJECT_signingKey: "${{ secrets.XPDUSTRY_MAVEN_SIGNING_KEY }}" | ||
ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.XPDUSTRY_MAVEN_SIGNING_PASSWORD }}" | ||
|
||
- name: Upload Artifacts to Release | ||
if: ${{ env.STATUS == 'release' && github.event_name == 'release' }} | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: build/tmp/release/*.jar | ||
file_glob: true | ||
tag: ${{ github.ref }} | ||
|
||
- name: Update Changelog | ||
if: ${{ env.STATUS == 'release' && github.event_name == 'release' }} | ||
uses: stefanzweifel/changelog-updater-action@v1 | ||
with: | ||
latest-version: ${{ github.event.release.tag_name }} | ||
release-notes: ${{ github.event.release.body }} | ||
|
||
- name: Commit Updated Changelog | ||
if: ${{ env.STATUS == 'release' && github.event_name == 'release' }} | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
branch: ${{ github.event.release.target_commitish }} | ||
commit_message: Update CHANGELOG | ||
file_pattern: CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## Gradle | ||
.gradle | ||
**/build/ | ||
!src/**/build/ | ||
!gradle-wrapper.jar | ||
|
||
## Eclipse | ||
bin/ | ||
.metadata/ | ||
.settings/ | ||
.classpath | ||
.project | ||
.loadpath | ||
|
||
## VSCode | ||
.vscode/* | ||
|
||
## Java | ||
*.class | ||
*.jar | ||
*.war | ||
*.rar | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
hs_err_pid* | ||
replay_pid* | ||
|
||
## Intellij | ||
.idea/ | ||
*.ipr | ||
*.iws | ||
*.iml | ||
|
||
## OS Specific | ||
.DS_Store | ||
Thumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/), | ||
and this project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
## v3.5.0 - 2023-11-07 | ||
|
||
### Changes | ||
|
||
- Complete refresh of the template to be up to date. | ||
- Made the README simpler. | ||
- Moved all configuration inside buildscript instead of being split into several files. | ||
|
||
## v3.4.0 - 2023-01-07 | ||
|
||
### Changes | ||
|
||
- Better README. | ||
|
||
### Chores | ||
|
||
- Bump dependencies. | ||
|
||
## v3.3.0 - 2022-11-08 | ||
|
||
### Changes | ||
|
||
- Switched the nullness annotations from jetbrains to checker (checker is better). | ||
|
||
### Features | ||
|
||
- Added option to enable/disable `-SNAPSHOT` suffix. | ||
|
||
### Fixes | ||
|
||
- Fixes a bug where java 8 is set as the project version. | ||
|
||
### Chores | ||
|
||
- Bumped workflow tasks. | ||
- Reworked the `README.md` to be simpler. | ||
|
||
## v3.2.0 - 2022-10-08 | ||
|
||
### 💊 Bugfixes | ||
|
||
- removed initial sha lookup in release-drafter | ||
|
||
### 🧹 Chore | ||
|
||
- bump dependencies | ||
- fix ci formatting | ||
- fix doc changelog | ||
|
||
## v3.1.0 - 2022-05-23 | ||
|
||
### 🚀 New Features | ||
|
||
- Release drafter is now a manual workflow | ||
|
||
## v3.0.4 - 2022-05-23 | ||
|
||
### Changes | ||
|
||
- Got rid of release-please... | ||
|
||
### 💊 Bugfixes | ||
|
||
- fixed missing status task in build workflow | ||
|
||
## [v3.0.3](https://github.com/Xpdustry/TemplatePlugin/compare/v3.0.3-SNAPSHOT...v3.0.3) - 2022-05-22 | ||
|
||
### Miscellaneous Chores | ||
|
||
- release 3.0.3 ([ef49fd2](https://github.com/Xpdustry/TemplatePlugin/commit/ef49fd26dc65b14449a1ca58985e8da2aaa43f62)) | ||
|
||
## [v3.0.2](https://github.com/Xpdustry/TemplatePlugin/compare/v3.0.1...v3.0.2) - 2022-05-21 | ||
|
||
### Bug Fixes | ||
|
||
- fix broken release ([b6581a4](https://github.com/Xpdustry/TemplatePlugin/commit/b6581a477826d19cf62dbe632c82d3f3d20edb64)) | ||
|
||
## [v3.0.1](https://github.com/Xpdustry/TemplatePlugin/compare/v3.0.0...v3.0.1) - 2022-05-21 | ||
|
||
### Bug Fixes | ||
|
||
- Added forgotten line for mindustry compile version ([e03bffc](https://github.com/Xpdustry/TemplatePlugin/commit/e03bffcb936c61fef663954a99eb1a9f696b3315)) | ||
|
||
## [v3.0.0](https://github.com/Xpdustry/TemplatePlugin/compare/v2.6.1...v3.0.0) - 2022-05-21 | ||
|
||
### ⚠ BREAKING CHANGES | ||
|
||
- Move to toxopid 2.0.0 | ||
|
||
### Features | ||
|
||
- Move to toxopid 2.0.0 ([9208e3c](https://github.com/Xpdustry/TemplatePlugin/commit/9208e3ce21b76437dccd65e510085f13c6540bbb)) | ||
|
||
### Bug Fixes | ||
|
||
- pls release-please, work ([ed558ee](https://github.com/Xpdustry/TemplatePlugin/commit/ed558ee00ed440400be6d1b1bf32cb7af0e5f203)) | ||
- remove comment in release-please.yml ([1fb8259](https://github.com/Xpdustry/TemplatePlugin/commit/1fb8259d931111371eb0f1c8f3915e97469456e1)) | ||
- updated license header ([fde8c59](https://github.com/Xpdustry/TemplatePlugin/commit/fde8c594acac66768d86cf372cda8ab604b13823)) | ||
|
||
## [v2.6.1](https://github.com/Xpdustry/TemplatePlugin/compare/v2.6.0...v2.6.1) - 2022-05-19 | ||
|
||
### Bug Fixes | ||
|
||
- Update changelog to follow release-please style ([9fdd102](https://github.com/Xpdustry/TemplatePlugin/commit/9fdd102941d30f3c386d6612d23ed92d3adfd968)) | ||
|
||
## [v2.6.0](https://github.com/Xpdustry/TemplatePlugin/compare/v2.5.1...v2.6.0) - 2022-05-19 | ||
|
||
### Features | ||
|
||
- Test release please ([3bb5d54](https://github.com/Xpdustry/TemplatePlugin/commit/3bb5d542dc8ba77583a837b2e21b89ea4f94a658)) | ||
|
||
### Bug Fixes | ||
|
||
- fix branch name in release-please ([ba2f978](https://github.com/Xpdustry/TemplatePlugin/commit/ba2f978c33bac4993f316eb58f062f8a18c007fa)) | ||
|
||
## [v2.5.1](https://github.com/Xpdustry/TemplatePlugin/compare/v2.5.0...v2.5.1) - 2022-05-17 | ||
|
||
### Added | ||
|
||
- Information about shading in the `README.md`. | ||
|
||
### Fixed | ||
|
||
- Typos in the `README.md`. | ||
|
||
## [v2.5.0](https://github.com/Xpdustry/TemplatePlugin/compare/v2.4.0...v2.5.0) - 2022-05-17 | ||
|
||
### Added | ||
|
||
- Added automatic shading task. | ||
- Added `indra.license-header` for license headers in files. | ||
|
||
### Changed | ||
|
||
- Updated `README.md` to be more explicit. | ||
- A little bit of formatting :^). | ||
|
||
## v2.4.0 - 2022-05-14 | ||
|
||
### Changed | ||
|
||
- Improved the usability of the Template. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* This file is part of TemplatePlugin. A template plugin for Mindustry to get you started quickly. | ||
* | ||
* MIT License | ||
* | ||
* Copyright (c) 2024 Xpdustry | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Xpdustry | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# template-plugin | ||
|
||
[![Build status](https://github.com/xpdustry/template-plugin/actions/workflows/build.yml/badge.svg?branch=master&event=push)](https://github.com/xpdustry/template-plugin/actions/workflows/build.yml) | ||
[![Mindustry 7.0 ](https://img.shields.io/badge/Mindustry-7.0-ffd37f)](https://github.com/Anuken/Mindustry/releases) | ||
|
||
Get your Mindustry plugin started with this awesome template repository, it features: | ||
|
||
- GitHub actions for easier testing (the plugin is built for each commit and pull request). | ||
|
||
- [Toxopid](https://plugins.gradle.org/plugin/com.xpdustry.toxopid) Gradle plugin for faster Mindustry plugin | ||
development and testing. | ||
|
||
- [Indra](https://plugins.gradle.org/plugin/net.kyori.indra) Gradle plugin for easier java development. | ||
|
||
- Bundling and automatic relocation (isolating your dependencies to avoid class loading issues) with the | ||
[Shadow](https://imperceptiblethoughts.com/shadow/) gradle plugin. | ||
|
||
- Unused classes are removed from the final jar. | ||
|
||
- A `CHANGELOG.md` file that will be updated automatically when you create a release on GitHub. | ||
|
||
## How to use | ||
|
||
1. Update the `build.gradle.kts`, `settings.gradle.kts` and `plugin.json` files with your plugin data. | ||
|
||
2. Clear `CHANGELOG.md` and update `LICENSE.md` with your name (or completely changing the license if needed) | ||
|
||
3. Start **K O D I N G**. | ||
|
||
4. When ready for a release, push your last changes with the release version. Then create a release on GitHub. Once published, the plugin jar will be built and added to the release and the `CHANGELOG.md` file will be updated with the release notes of the GitHub release. | ||
|
||
## Installation | ||
|
||
This plugin requires : | ||
|
||
- Java 17 or above. | ||
|
||
- Mindustry v146 or above. | ||
|
||
## Building | ||
|
||
- `./gradlew shadowJar` to compile the plugin into a usable jar (will be located | ||
at `builds/libs/(plugin-name).jar`). | ||
|
||
- `./gradlew runMindustryServer` to run the plugin in a local Mindustry server. | ||
|
||
- `./gradlew runMindustryDesktop` to start a local Mindustry client that will let you test the plugin. | ||
|
||
## Note | ||
|
||
If you are from Xpdustry, before doing anything, run this in your terminal to set the `xpdustry-master` branch as master : | ||
|
||
```bash | ||
git fetch origin xpdustry-master | ||
git checkout xpdustry-master | ||
git branch -m master old-master | ||
git branch -m xpdustry-master master | ||
git branch -rD origin/master | ||
git push origin master -f | ||
git branch -D old-master | ||
git push origin --delete xpdustry-master | ||
``` |
Oops, something went wrong.