Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Release Automation via GitHub Actions, Gradle Build Integration, and New Fake Player Multiplier #23

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
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
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Create Release

on:
push:
branches:
- master

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Grant execute permission to gradlew
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew build

- name: Extract version from build.gradle
id: extract_version
run: |
VERSION=$(grep '^version' build.gradle | awk '{print $3}' | tr -d "'")
echo "VERSION=$VERSION" >> $GITHUB_ENV

- name: Get short commit hash
id: get_commit_hash
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

- name: Create Git Tag
run: |
TAG_NAME="${{ env.VERSION }}-${{ env.COMMIT_HASH }}"
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "$TAG_NAME" -m "Release version $TAG_NAME"
git push origin "$TAG_NAME"
env:
VERSION: ${{ env.VERSION }}
COMMIT_HASH: ${{ env.COMMIT_HASH }}

- name: Generate Release Notes
id: generate_release_notes
run: |
COMMITS=$(git log --oneline)

# Generate release notes
echo "## Changelog" > release_notes.md
echo "" >> release_notes.md
echo "$COMMITS" >> release_notes.md
cat release_notes.md

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "${{ env.VERSION }}-${{ env.COMMIT_HASH }}"
files: build/libs/*.jar
body_path: release_notes.md

- name: Clean up
run: rm release_notes.md
26 changes: 25 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,28 @@
.settings
.factorypath
.classpath
/target
/target

# .gitignore for a Gradle project

# Ignore Gradle build artifacts
/build/
/out/
/target/

# Ignore Gradle dependency caches
.gradle/
/build/

# Ignore IDE-specific files
/.idea/
/*.iml
/.vscode/
/*.swp

# Ignore log files
*.log

# Ignore OS-specific files
.DS_Store
Thumbs.db
87 changes: 85 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,85 @@
# CleanMOTD
Simple and light plugin to manage the motd of your server.

# CleanMOTD Plugin

## Overview

This is a free BungeeCord/Spigot plugin that is a light, simple but complete motd manager plugin that overrides the default BungeeCord motd system, to make it more capable while being light and good performant.

There are some plugins that makes lot of heavy actions when players ping the server, this one instead keeps everything safe, light and clean.

You can use this plugin installed with another MOTD plugin to improve performance. CleanMotD will automatically give priority to the other plugin if you disable the "motd" option in CleanMotD.

This plugin was mainly made for ArkFlame Network, but i published it because it will help people and the development of the plugin by finding bugs, getting new ideas, etc...

## Features

- **Flexible Configuration**
- **Multiple Random MOTDs**
- **JustOneMore MaxPlayers**
- **Advanced FakePlayers System**
- **Customizable Player Sample List**
- **Customizable Protocol Version Name**
- **Packet Use with ProtocolLib**
- **Minimal Performance Impact**

## Commands

- `/cleanmotd help` - Shows the available commands.
- `/cleanmotd reload` - Reloads the configuration.

## Permissions

- `cleanmotd.admin` - Permission to use commands.

## Installation

1. Stop your server.
2. Download and place the plugin .jar file into your plugins folder.
3. Start your server to generate configuration files.
4. Customize the configurations as needed and reload the plugin.

## Building from Source

To build CleanMOTD from the source, follow these steps:

1. Clone the repository:
```sh
git clone https://github.com/2lstudios-mc/CleanMOTD.git
cd CleanMOTD
```

2. Build the plugin using Gradle:
```sh
./gradlew build
```

3. The built .jar file will be located in the `build/libs` directory.

## Contributing

We welcome contributions! Here's how you can help:

1. Fork the repository.
2. Create a new branch:
```sh
git checkout -b feature-branch
```
3. Make your changes and commit them:
```sh
git commit -m "Description of changes"
```
4. Push to your branch:
```sh
git push origin feature-branch
```
5. Open a pull request on GitHub.

## License

This project is licensed under the MIT License. Feel free to use, modify, and distribute it as you see fit.

## Links

- [GitHub Repository](https://github.com/2lstudios-mc/CleanMOTD)
- [SpigotMC Resource Page](https://www.spigotmc.org/resources/2ls-cleanmotd-the-ligthest-motd-plugin.58268/)

62 changes: 62 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
plugins {
id 'java'
}

group = 'dev._2lstudios'
version = '0.2.8'

ext {
author = '2LS'
projectName = 'CleanMOTD'
url = 'https://www.spigotmc.org/resources/58268/'
description = 'Simple MOTD customization plugin'
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

// Repositories
repositories {
mavenCentral()
maven {
name = 'spigot-repo'
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
name = 'bungeecord-repo'
url = 'https://oss.sonatype.org/content/repositories/snapshots'
}
maven {
name = 'dmulloy2-repo'
url = 'https://repo.dmulloy2.net/repository/public/'
}
maven {
name = 'papermc'
url = 'https://repo.papermc.io/repository/maven-public/'
}
}

// Dependencies
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
compileOnly 'com.velocitypowered:velocity-api:3.1.1'
compileOnly 'io.netty:netty-all:4.1.63.Final'
compileOnly 'com.comphenix.protocol:ProtocolLib:4.6.0'
compileOnly 'net.md-5:bungeecord-api:1.16-R0.5-SNAPSHOT'
annotationProcessor("com.velocitypowered:velocity-api:3.1.1")
}

// Ensure yml has the version and other properties defined here
processResources {
filesMatching('**/*.yml') {
expand(project.properties) // Expands all project properties including 'author', 'version', etc.
}
}

// Create a fat jar at: build/libs/
jar {
from {
duplicatesStrategy DuplicatesStrategy.INCLUDE // primarily META-INF duplicates
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading