diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a8ad2a..043b52a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,9 +31,12 @@ jobs: - name: Build and publish with gradle uses: gradle/gradle-build-action@v2 with: - arguments: modrinth + arguments: modrinth publish env: MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + MAVEN_URL: ${{ secrets.MAVEN_URL }} + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - name: Upload GitHub release uses: AButler/upload-release-assets@v2.0 diff --git a/build.gradle.kts b/build.gradle.kts index bc23cab..834b8b7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } version = "1.5.0+1.19" -group = "io.github.ashhhleyyy" +group = "dev.ashhhleyyy" repositories { // needed for placeholder-api @@ -80,3 +80,24 @@ modrinth { required.project("fabric-api") } } + +publishing { + publications.create("maven") { + from(components["java"]) + } + + repositories { + if (System.getenv("MAVEN_URL") != null) { + maven { + name = "ashhhleyyy" + setUrl(System.getenv("MAVEN_URL")) + credentials { + username = System.getenv("MAVEN_USERNAME") + password = System.getenv("MAVEN_PASSWORD") + } + } + } else { + mavenLocal() + } + } +}