From e592086dc67fcc77bb6a3a9f288c388e1ccdd82f Mon Sep 17 00:00:00 2001 From: Dawson Date: Mon, 1 Jul 2024 16:22:23 -0400 Subject: [PATCH] Auto publish to modrinth, perchance? --- .github/workflows/publish.yml | 26 ++++++++++++++++++++++++++ build.gradle.kts | 8 ++++++++ plugin/build.gradle.kts | 4 +++- settings.gradle.kts | 2 +- 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 build.gradle.kts diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..14b78d0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: Publish to Modrinth +on: + push: + branches: + - master + - dev + +jobs: + publish: + if: github.repository_owner == 'flytegg' + runs-on: ubuntu-22.04 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Validate Gradle Wrapper + uses: gradle/actions/wrapper-validation@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + check-latest: true + - name: Publish + env: + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + run: ./gradlew build modrinth --stacktrace \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..2618d66 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + base +} + +allprojects { + group = "gg.flyte" + version = property("projectVersion") as String +} \ No newline at end of file diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index d5b1353..b3196db 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -47,6 +47,8 @@ tasks { shadowJar { archiveClassifier.set("") + archiveFileName.set("PluginPortal-${project.version}.jar") + minimize() relocate("com.google.gson", "gg.flyte.pluginportal.libs.gson") @@ -92,7 +94,7 @@ if (!isRelease || isMainBranch) { // Only publish releases from the main branch // hangarPublish { // publications.register("plugin") { // version.set(suffixedVersion) -// id.set("ViaVersion") +// id.set("PluginPortal") // channel.set(if (isRelease) "Release" else if (isMainBranch) "Snapshot" else "Alpha") // changelog.set(changelogContent) // apiKey.set(System.getenv("HANGAR_TOKEN")) diff --git a/settings.gradle.kts b/settings.gradle.kts index 890b13f..ca9672b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -11,4 +11,4 @@ plugins { } rootProject.name = "plugin-portal" -include("common", "plugin") +include("common", "plugin") \ No newline at end of file