add maven stuff

This commit is contained in:
maggi373 2022-04-29 02:13:20 +02:00
parent e9ab1095df
commit 80bd73dd62
3 changed files with 88 additions and 2 deletions

30
.github/workflows/maven.yml vendored Normal file
View file

@ -0,0 +1,30 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Publish package to the Maven Central Repository
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Publish
run: ./gradlew artifactoryPublish
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_TOKEN }}

3
.gitignore vendored
View file

@ -21,4 +21,5 @@ MDK.zip
*.mtl
*.blend1
*.blend2
/bin
/bin
gradle.properties

View file

@ -11,7 +11,7 @@ buildscript {
classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.0.+') {
changing = true
}
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.27.1"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release"
}
}
@ -175,3 +175,58 @@ task fullBuild(type: Delete) {
fullBuild.dependsOn('releaseJars')
artifactory {
contextUrl = System.getenv("MAVEN_URL")
publish {
repository {
repoKey = 'thorfusion'
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
maven = true
}
defaults {
publications('mavenJava')
}
publishBuildInfo = false
publishArtifacts = true
publishPom = true
}
resolve {
repository {
repoKey = 'central'
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
maven = true
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifactId = rootProject.name
groupId = project.group
version = project.version
artifacts = [coreJar, toolsJar, generatorsJar, MDKZip, alltJar]
pom {
name.set("Mekanism Community Edition")
packaging = 'jar'
description.set('Mekanism is a Minecraft add-on featuring high-tech machinery that can be used to create powerful tools, armor, and weapons.')
url.set('https://aidancbrady.com/mekanism/')
issueManagement {
system.set('github')
url.set('https://github.com/Thorfusion/Mekanism-1.7.10-Community-Edition/issues')
}
licenses {
license {
name.set('CC BY-NC-SA 4.0')
distribution.set('repo')
}
}
}
}
}
}