-
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.
Merge pull request #4 from APDevTeam/gradle-v2
Gradle v2
- Loading branch information
Showing
8 changed files
with
105 additions
and
202 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,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 |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -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") | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
*/ | ||
|
||
rootProject.name = "APAutoNPC" |
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