Skip to content
Merged
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
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Format Check

on:
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"

- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: "3.9.5"

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Build & Format Check with Maven
run: mvn -B verify
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release Plugin

on:
push:
tags:
- "v*.*.*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Build with Maven
run: mvn -B package -DskipTests

- name: Create Release and Upload Artifact
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: target/*.jar
17 changes: 17 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,28 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>

<plugin>
<groupId>com.github.gantsign.maven</groupId>
<artifactId>ktlint-maven-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>format-and-check</id>
<phase>process-sources</phase>
<goals>
<goal>format</goal>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
2 changes: 1 addition & 1 deletion src/main/kotlin/com/pool25m/logtime/LogTimePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ class LogTimePlugin : JavaPlugin() {
override fun onDisable() {
logger.info("LogTime Plugin has been disabled.")
}
}
}
11 changes: 8 additions & 3 deletions src/main/kotlin/com/pool25m/logtime/RankingCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ import org.bukkit.command.CommandExecutor
import org.bukkit.command.CommandSender

class RankingCommand : CommandExecutor {
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean {
override fun onCommand(
sender: CommandSender,
command: Command,
label: String,
args: Array<out String>,
): Boolean {
sender.sendMessage("LogTime plugin is working!")

return true
}
}
}
Loading