Skip to content

Commit

Permalink
Auto publish to modrinth, perchance?
Browse files Browse the repository at this point in the history
  • Loading branch information
Dawsson committed Jul 1, 2024
1 parent e77c7f4 commit e592086
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins {
base
}

allprojects {
group = "gg.flyte"
version = property("projectVersion") as String
}
4 changes: 3 additions & 1 deletion plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ tasks {

shadowJar {
archiveClassifier.set("")
archiveFileName.set("PluginPortal-${project.version}.jar")


minimize()
relocate("com.google.gson", "gg.flyte.pluginportal.libs.gson")
Expand Down Expand Up @@ -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"))
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ plugins {
}

rootProject.name = "plugin-portal"
include("common", "plugin")
include("common", "plugin")

0 comments on commit e592086

Please sign in to comment.