From 72df7b1602e4d01b9240750878f4cdeeb5a1a89a Mon Sep 17 00:00:00 2001 From: zhangyuheng Date: Thu, 11 Jan 2024 23:59:25 +0800 Subject: [PATCH] init --- .gitea/workflows/build.yml | 40 +++++++ .gitignore | 113 ++++++++++++++++++ pom.xml | 75 ++++++++++++ .../cn/lunadeer/essentialsd/EssentialsD.java | 17 +++ src/main/resources/plugin.yml | 23 ++++ 5 files changed, 268 insertions(+) create mode 100644 .gitea/workflows/build.yml create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/cn/lunadeer/essentialsd/EssentialsD.java create mode 100644 src/main/resources/plugin.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..9ab48f1 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,40 @@ +name: Java CI-CD with Maven + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: "Pull & Checkout" + uses: https://ssl.lunadeer.cn:14446/actions/checkout@v3 + with: + fetch-depth: 0 + - name: "Set up Maven" + uses: https://ssl.lunadeer.cn:14446/actions/setup-maven@v4 + - name: "Set up JDK 17" + uses: https://ssl.lunadeer.cn:14446/actions/setup-java@v3 + with: + java-version: '17' + distribution: 'zulu' + cache: maven + - name: "Build with Maven" + run: mvn -B package --file pom.xml + - name: "Copy jar to staging" + run: mkdir staging && cp target/*.jar staging + - name: "Build & test" + run: | + echo "done!" + - name: "setup go for release script" + uses: https://ssl.lunadeer.cn:14446/actions/setup-go@v4 + with: + go-version: '>=1.20.1' + - name: "Release" + uses: https://ssl.lunadeer.cn:14446/actions/release-action@main + with: + files: |- + staging/*.jar + api_key: '${{secrets.RELEASE_TOKEN}}' \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4788b4b --- /dev/null +++ b/.gitignore @@ -0,0 +1,113 @@ +# User-specific stuff +.idea/ + +*.iml +*.ipr +*.iws + +# IntelliJ +out/ + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +target/ + +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next + +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar +.flattened-pom.xml + +# Common working directory +run/ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..ba015a9 --- /dev/null +++ b/pom.xml @@ -0,0 +1,75 @@ + + + 4.0.0 + + cn.lunadeer + EssentialsD + 0.1 + jar + + EssentialsD + + + 1.8 + UTF-8 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + package + + shade + + + + + + + + src/main/resources + true + + + + + + + papermc-repo + https://repo.papermc.io/repository/maven-public/ + + + sonatype + https://oss.sonatype.org/content/groups/public/ + + + papermc + https://repo.papermc.io/repository/maven-public/ + + + + + + dev.folia + folia-api + 1.20.1-R0.1-SNAPSHOT + provided + + + diff --git a/src/main/java/cn/lunadeer/essentialsd/EssentialsD.java b/src/main/java/cn/lunadeer/essentialsd/EssentialsD.java new file mode 100644 index 0000000..7aa01e1 --- /dev/null +++ b/src/main/java/cn/lunadeer/essentialsd/EssentialsD.java @@ -0,0 +1,17 @@ +package cn.lunadeer.essentialsd; + +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +public final class EssentialsD extends JavaPlugin { + + @Override + public void onEnable() { + // Plugin startup logic + } + + @Override + public void onDisable() { + // Plugin shutdown logic + } +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..6d0b76f --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,23 @@ +name: EssentialsD +version: '${project.version}' +main: cn.lunadeer.essentialsd.EssentialsD +api-version: '1.20' +description: Deer's Essentials +website: https://lunadeer.cn +folia-supported: true +commands: + suicide: + description: 自杀 + usage: /suicide + invisibleItemFrame: + description: 使用一个展示框交换一个隐形展示框 + usage: /invisibleItemFrame + armorStand: + description: 使用一个盔甲架生成一个自定义盔甲架 + usage: /armorStand + hat: + description: 将右手持的物品放在头部 + usage: /hat + showItem: + description: 展示右手的物品 + usage: /showItem \ No newline at end of file