feat: deploy releases to maven

This commit is contained in:
Ashhhleyyy 2022-08-17 15:13:07 +01:00
parent 7b87d76ec3
commit 0ada3f4419
Signed by: ash
GPG key ID: 83B789081A0878FB
2 changed files with 26 additions and 2 deletions

View file

@ -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

View file

@ -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<MavenPublication>("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()
}
}
}