Skip to content

Commit

Permalink
Merge branch 'APDevTeam:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
goodroach authored Nov 12, 2024
2 parents e400d37 + d91137d commit a89bf7c
Show file tree
Hide file tree
Showing 33 changed files with 1,379 additions and 514 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
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 Movecraft-Combat
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: Publish to PaperMC Hangar
if: ${{ github.event_name == 'release' }}
run: ./gradlew publishPluginPublicationToHangar --parallel
env:
HANGAR_API_TOKEN: ${{ secrets.HANGAR_API_TOKEN }}

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

- name: Stage jar for Release
if: ${{ github.event_name == 'release' }}
run: mkdir staging && cp build/libs/Movecraft-Combat.jar staging && mv staging/Movecraft-Combat.jar staging/Movecraft-Combat_${{ 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/Movecraft-Combat_${{ github.event.release.tag_name }}.jar
46 changes: 0 additions & 46 deletions .github/workflows/maven.yml

This file was deleted.

25 changes: 24 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,27 @@ hs_err_pid*
*.iml
target/*
libs/*
.vscode*
.vscode*

### GitHub example for gradle
.gradle
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Movecraft Combat Addon
![Combat](https://github.com/TylerS1066/Movecraft-Combat/actions/workflows/maven.yml/badge.svg)
![Combat](https://github.com/APDevTeam/Movecraft-Combat/actions/workflows/gradle.yml/badge.svg)
[![Codebeat](https://codebeat.co/badges/8ea3227d-0125-4cd5-896f-834f66011791)](https://codebeat.co/projects/github-com-apdevteam-movecraft-combat-main)

Home of the code for the following features:
- AA Directors
- Arrow Directors
- Cannon Directors
- Contact Explosives
- Durability Override
Expand All @@ -23,22 +24,21 @@ The `main` branch is coded for 1.14.4 and up with Movecraft 8.x.
The `legacy` branch is coded for 1.10.2 to 1.12.2 and Movecraft 7.x.

## Download
Devevlopment builds can be found on the [GitHub Actions tab](https://github.com/TylerS1066/Movecraft-Combat/actions) of this repository.
Releases can be found on the [releases tab](https://github.com/APDevTeam/Movecraft-Combat/releases).

Stable builds can be found on [our SpigotMC page](https://www.spigotmc.org/resources/movecraft-combat.81574/).
Development builds can be found on the [GitHub Actions tab](https://github.com/APDevTeam/Movecraft-Combat/actions) of this repository.

## Building
This plugin requires that the user setup their GitHub token in maven to authenticate with GitHub Packages, as described in [this wiki page](https://github.com/APDevTeam/Movecraft/wiki/Documentation).
Previous builds can be found on [our SpigotMC page](https://www.spigotmc.org/resources/movecraft-combat.81574/).

Then, run the following to build Movecraft-Combat through `maven`.
## Building
Run the following to build Movecraft-Combat:
```
mvn clean install
./gradlew clean build --parallel
```
Jars are located in `/target`.

Jars are located in `/build/libs` directory.

## Support
[Github Issues](https://github.com/TylerS1066/Movecraft-Combat/issues)
[Github Issues](https://github.com/APDevTeam/Movecraft-Combat/issues)

[Discord](http://bit.ly/JoinAP-Dev)

Expand Down
81 changes: 81 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
plugins {
`java-library`
`maven-publish`
id("io.github.0ffz.github-packages") version "1.2.1"
id("io.papermc.hangar-publish-plugin") version "0.1.2"
}

repositories {
gradlePluginPortal()
mavenLocal()
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven { githubPackage("apdevteam/movecraft")(this) }
}

dependencies {
api("org.jetbrains:annotations-java5:24.1.0")
compileOnly("io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT")
compileOnly("net.countercraft:movecraft:+")
compileOnly("it.unimi.dsi:fastutil:8.5.11")
}

group = "net.countercraft.movecraft.combat"
version = "2.0.0_beta-6"
description = "Movecraft-Combat"
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

tasks.jar {
archiveBaseName.set("Movecraft-Combat")
archiveClassifier.set("")
archiveVersion.set("")
}

tasks.processResources {
from(rootProject.file("LICENSE.md"))
filesMatching("*.yml") {
expand(mapOf("projectVersion" to project.version))
}
}

publishing {
publications {
create<MavenPublication>("maven") {
groupId = "net.countercraft.movecraft.combat"
artifactId = "movecraft-combat"
version = "${project.version}"

artifact(tasks.jar)
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/apdevteam/movecraft-combat")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

hangarPublish {
publications.register("plugin") {
version.set(project.version as String)
channel.set("Release")
id.set("Airship-Pirates/Movecraft-Combat")
apiKey.set(System.getenv("HANGAR_API_TOKEN"))
platforms {
register(io.papermc.hangarpublishplugin.model.Platforms.PAPER) {
jar.set(tasks.jar.flatMap { it.archiveFile })
platformVersions.set(listOf("1.18.2-1.21.1"))
dependencies {
hangar("Movecraft") {
required.set(true)
}
}
}
}
}
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit a89bf7c

Please sign in to comment.