mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 15:24:48 +01:00
ci(java): try with gradle-maven-publish-plugin
This commit is contained in:
parent
b65dc1ca45
commit
24ef0db727
2 changed files with 43 additions and 58 deletions
12
.github/workflows/java.yml
vendored
12
.github/workflows/java.yml
vendored
|
@ -40,12 +40,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: codemp-java-${{ matrix.platform.target }}
|
name: codemp-java-${{ matrix.platform.target }}
|
||||||
path: dist/java/build/libs
|
path: dist/java/build/libs
|
||||||
- run: gradle publish
|
- run: gradle publishAllPublicationsToMavenCentralRepository
|
||||||
working-directory: dist/java
|
working-directory: dist/java
|
||||||
env:
|
env:
|
||||||
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
|
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
|
||||||
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
|
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
|
||||||
MAVEN_CENTRAL_GPG_SECRET_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_SECRET_KEY }}
|
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_CENTRAL_GPG_SECRET_KEY }}
|
||||||
MAVEN_CENTRAL_GPG_PASSWORD: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }}
|
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }}
|
||||||
|
|
||||||
# TODO add a publish step to maven central
|
|
||||||
|
|
89
dist/java/build.gradle
vendored
89
dist/java/build.gradle
vendored
|
@ -1,7 +1,7 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'java-library'
|
id 'java-library'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
id 'signing'
|
id "com.vanniktech.maven.publish" version "0.29.0"
|
||||||
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,42 @@ java {
|
||||||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import com.vanniktech.maven.publish.SonatypeHost
|
||||||
|
|
||||||
|
mavenPublishing {
|
||||||
|
publishToMavenCentral(SonatypeHost.DEFAULT)
|
||||||
|
// publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
|
||||||
|
|
||||||
|
signAllPublications()
|
||||||
|
|
||||||
|
coordinates("mp.code", "codemp", "0.0.1-SNAPSHOT")
|
||||||
|
|
||||||
|
pom {
|
||||||
|
name = "codemp"
|
||||||
|
description = "a collaborative editor plugin ecosystem"
|
||||||
|
inceptionYear = "2022"
|
||||||
|
url = "https://code.mp/"
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name = "The GNU General Public License v3.0"
|
||||||
|
url = "https://www.gnu.org/licenses/gpl-3.0.txt"
|
||||||
|
distribution = "https://www.gnu.org/licenses/gpl-3.0.txt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id = "zaaarf"
|
||||||
|
name = "zaaarf"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm {
|
||||||
|
url = "https://github.com/hexedtech/codemp/"
|
||||||
|
connection = "scm:git:git://github.com/hexedtech/codemp.git"
|
||||||
|
developerConnection = "scm:git:ssh://git@github.com/hexedtech/codemp.git"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url 'https://jitpack.io' }
|
maven { url 'https://jitpack.io' }
|
||||||
|
@ -40,6 +76,7 @@ def rustDir = projectDir.toPath()
|
||||||
.resolve('target')
|
.resolve('target')
|
||||||
.resolve('release')
|
.resolve('release')
|
||||||
.toFile()
|
.toFile()
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
outputs.upToDateWhen { false } // no caching
|
outputs.upToDateWhen { false } // no caching
|
||||||
from(rustDir) {
|
from(rustDir) {
|
||||||
|
@ -57,53 +94,3 @@ tasks.register('cargoBuild', Exec) {
|
||||||
|
|
||||||
processResources.dependsOn cargoBuild
|
processResources.dependsOn cargoBuild
|
||||||
build.finalizedBy shadowJar
|
build.finalizedBy shadowJar
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
mavenJava(MavenPublication) {
|
|
||||||
artifactId = rootProject.name
|
|
||||||
version = project.version
|
|
||||||
from components.java
|
|
||||||
pom {
|
|
||||||
name = 'codemp'
|
|
||||||
description = 'A collaborative editor plugin ecosystem'
|
|
||||||
url = 'https://code.mp'
|
|
||||||
licenses {
|
|
||||||
license {
|
|
||||||
name = 'The GNU General Public License v3.0'
|
|
||||||
url = 'https://www.gnu.org/licenses/gpl-3.0.txt'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
developers {
|
|
||||||
developer {
|
|
||||||
id = 'zaaarf'
|
|
||||||
email = 'zaaarf@codemp.dev'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
scm {
|
|
||||||
connection = 'scm:git:git://github.com/hexedtech/codemp.git'
|
|
||||||
developerConnection = 'scm:git:ssh://github.com/hexedtech/codemp.git'
|
|
||||||
url = 'https://github.com/hexedtech/codemp/'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
name = "centralManualTesting"
|
|
||||||
url "https://central.sonatype.com/api/v1/publisher/deployments/download/"
|
|
||||||
credentials {
|
|
||||||
username = System.getenv('MAVEN_CENTRAL_USERNAME')
|
|
||||||
password = System.getenv('MAVEN_CENTRAL_PASSWORD')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
signing {
|
|
||||||
def signingKey = System.getenv('MAVEN_CENTRAL_GPG_SECRET_KEY')
|
|
||||||
def signingPassword = System.getenv('MAVEN_CENTRAL_GPG_PASSWORD')
|
|
||||||
useInMemoryPgpKeys(signingKey, signingPassword)
|
|
||||||
sign publishing.publications.mavenJava
|
|
||||||
}
|
|
Loading…
Reference in a new issue