-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update .gitignore * Gradle init * Update build * Update README.md * Update CI * Changing permission of gradlew
- Loading branch information
1 parent
4433e34
commit 7025ba7
Showing
12 changed files
with
533 additions
and
177 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,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 Beaming | ||
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/Beaming.jar staging && mv staging/Beaming.jar staging/Beaming_$GITHUB_SHA.jar | ||
- name: Upload jar to Actions | ||
if: ${{ github.event_name != 'release' }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Beaming_Dev-Build | ||
path: staging/Beaming_*.jar | ||
|
||
- name: Stage jar for Release | ||
if: ${{ github.event_name == 'release' }} | ||
run: mkdir staging && cp build/libs/Beaming.jar staging && mv staging/Beaming.jar staging/Beaming_${{ 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/Beaming_${{ 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
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
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,85 @@ | ||
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) } | ||
maven("https://repo.essentialsx.net/releases/") | ||
} | ||
|
||
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("net.essentialsx:EssentialsX:2.20.1") | ||
} | ||
|
||
group = "net.TylerS1066.Beaming" | ||
version = "2.0.0_beta-1_gradle" | ||
description = "Beaming" | ||
java.toolchain.languageVersion = JavaLanguageVersion.of(17) | ||
|
||
tasks.jar { | ||
archiveBaseName.set("Beaming") | ||
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.TylerS1066.beaming" | ||
artifactId = "beaming" | ||
version = "${project.version}" | ||
|
||
artifact(tasks.jar) | ||
} | ||
} | ||
repositories { | ||
maven { | ||
name = "GitHubPackages" | ||
url = uri("https://maven.pkg.github.com/apdevteam/beaming") | ||
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/Beaming") | ||
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")) | ||
dependencies { | ||
hangar("Movecraft") { | ||
required.set(true) | ||
} | ||
hangar("Essentials") { | ||
required.set(false) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
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,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 |
Oops, something went wrong.