Skip to content

Commit

Permalink
Merge pull request #4 from APDevTeam/gradle-v2
Browse files Browse the repository at this point in the history
Gradle v2
  • Loading branch information
TylerS1066 authored Sep 11, 2024
2 parents 0b6b1d4 + c90f030 commit 88f21b7
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 202 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Gradle CI

on:
workflow_dispatch:
push:
pull_request:
release:
types: [created, prereleased]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
- name: Checkout APAutoNPC
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"

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

- name: Publish to GitHub Packages
if: ${{ github.event_name == 'release' }}
run: ./gradlew publish --parallel
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Stage jar for Actions
if: ${{ github.event_name != 'release' }}
run: mkdir staging && cp build/libs/APAutoNPC.jar staging && mv staging/APAutoNPC.jar staging/APAutoNPC_$GITHUB_SHA.jar
- name: Upload jar to Actions
if: ${{ github.event_name != 'release' }}
uses: actions/upload-artifact@v4
with:
name: APAutoNPC_Dev-Build
path: staging/APAutoNPC_*.jar

- name: Stage jar for Release
if: ${{ github.event_name == 'release' }}
run: mkdir staging && cp build/libs/APAutoNPC.jar staging && mv staging/APAutoNPC.jar staging/APAutoNPC_${{ github.event.release.tag_name }}.jar
- name: Upload jar to Release
if: ${{ github.event_name == 'release' }}
uses: softprops/action-gh-release@v2
with:
files: staging/APAutoNPC_${{ github.event.release.tag_name }}.jar
30 changes: 0 additions & 30 deletions .github/workflows/maven.yml

This file was deleted.

91 changes: 45 additions & 46 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,66 +1,65 @@
/*
* This file was generated by the Gradle 'init' task.
*/

plugins {
`java-library`
`maven-publish`
id("io.github.0ffz.github-packages") version "1.2.1"
}

repositories {
mavenLocal()
maven {
url = uri("https://maven.pkg.github.com/APDevTeam/Movecraft")
}

maven {
url = uri("https://repo.maven.apache.org/maven2/")
}

maven {
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}

maven {
url = uri("https://maven.enginehub.org/repo/")
}

maven {
url = uri("https://repo.citizensnpcs.co/")
}

maven {
url = uri("https://oss.sonatype.org/content/groups/public/")
}

maven {
url = uri("https://jitpack.io")
}
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven { githubPackage("apdevteam/movecraft")(this) }
maven("https://maven.enginehub.org/repo/")
maven("https://repo.citizensnpcs.co/")
maven("https://jitpack.io")
}

dependencies {
api(libs.net.citizensnpcs.citizens.main)
compileOnly(libs.org.spigotmc.spigot.api)
compileOnly(libs.com.sk89q.worldguard.worldguard.bukkit)
compileOnly(libs.com.github.milkbowl.vaultapi)
system(libs.com.degitise.minevid.dtltraders)
api("org.jetbrains:annotations-java5:24.1.0")
compileOnly("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")
compileOnly("net.countercraft:movecraft:+")
compileOnly("net.citizensnpcs:citizensapi:+")
compileOnly(files("libs/dtlTraders.jar"))
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1")
api("com.sk89q.worldguard:worldguard-bukkit:7.0.10")
}

group = "net.apdevteam.apautonpc"
version = "4.0.0_beta-2"
version = "4.0.0_beta-2_gradle"
description = "APAutoNPC"
java.sourceCompatibility = JavaVersion.VERSION_13
java.toolchain.languageVersion = JavaLanguageVersion.of(21)

publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
}
tasks.jar {
archiveBaseName.set("APAutoNPC")
archiveClassifier.set("")
archiveVersion.set("")
}

tasks.withType<JavaCompile>() {
options.encoding = "UTF-8"
tasks.processResources {
from(rootProject.file("LICENSE.md"))
filesMatching("*.yml") {
expand(mapOf("projectVersion" to project.version))
}
}

tasks.withType<Javadoc>() {
options.encoding = "UTF-8"
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "net.apdevteam.apautonpc"
artifactId = "apautonpc"
version = "${project.version}"

artifact(tasks.jar)
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/apdevteam/apautonpc")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
16 changes: 0 additions & 16 deletions gradle/libs.versions.toml

This file was deleted.

Empty file modified gradlew
100644 → 100755
Empty file.
104 changes: 0 additions & 104 deletions pom.xml

This file was deleted.

4 changes: 0 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
/*
* This file was generated by the Gradle 'init' task.
*/

rootProject.name = "APAutoNPC"
4 changes: 2 additions & 2 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: APAutoNPC
version: ${project.version}
version: ${projectVersion}
main: net.apdevteam.apautonpc.APAutoNPC
api-version: 1.14
api-version: 1.20
authors: [TylerS1066, _MrUniverse, APDevTeam]
depend: [WorldGuard, WorldEdit, Vault, Citizens, dtlTraders]
commands:
Expand Down

0 comments on commit 88f21b7

Please sign in to comment.