Skip to content

Commit

Permalink
feat:maven publish
Browse files Browse the repository at this point in the history
Signed-off-by: grapebaba <281165273@qq.com>
  • Loading branch information
GrapeBaBa committed Sep 1, 2023
1 parent 5304d0c commit 6c809e1
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 11 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ jobs:
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_SIGN_PW }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 8
java-version: 17
distribution: 'temurin'

- name: Setup Gradle
Expand All @@ -40,13 +37,10 @@ jobs:
packages: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 8
java-version: 17
distribution: 'temurin'

- name: Setup Gradle
Expand Down
58 changes: 57 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = 'me.grapebaba'
version = '0.1.0-SNAPSHOT'
version = '0.1.0'

repositories {
mavenCentral()
Expand Down Expand Up @@ -126,6 +126,62 @@ spotless {
}
}

publishing {
publications {
mavenJava(MavenPublication) {

from components.java

pom {
name = rootProject.name
description = 'Client library for Flashbots MEV-share Matchmaker.'
url = 'https://github.com/optimism-java/mev-share-java'

licenses {
license {
name = 'MIT License'
}
}
developers {
developer {
id = 'grapebaba'
name = 'Kai Chen'
email = '281165273grape@gmail.com'
}
}
scm {
connection = 'scm:git:git://github.com/optimism-java/' + rootProject.name + '.git'
developerConnection = 'scm:git:ssh://github.com/optimism-java/' + rootProject.name + '.git'
url = 'https://github.com/optimism-java/' + rootProject.name
}
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/optimism-java/" + rootProject.name
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

signing {
sign publishing.publications.mavenJava
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
}

nexusPublishing {
repositories {
sonatype()
}
}

tasks.register('printSourceDirs') {
print("$projectDir\n")
print(sourceSets)
Expand Down

0 comments on commit 6c809e1

Please sign in to comment.