From 72de4307457b93d5db065ccfaf12be7e2f71ffb0 Mon Sep 17 00:00:00 2001 From: Fuxiang Luo Date: Sun, 6 Nov 2022 12:42:04 +0800 Subject: [PATCH 1/2] update publish info --- README.md | 6 ++--- .../groovy/local-s3.java-conventions.gradle | 2 +- .../src/main/groovy/local-s3.publish.gradle | 25 +++++++++++++++++++ local-s3-docker/build.gradle | 2 +- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8f012c2..839d7af 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # LocalS3 [![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/Robothy/local-s3?display_name=tag&color=blueviolet)](https://github.com/Robothy?tab=packages&repo_name=local-s3) -[![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?logo=docker&logoColor=white)](https://hub.docker.com/repository/docker/luofuxiang/local-s3) +[![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/luofuxiang/local-s3) LocalS3 is a lightweight Amazon S3 mock service based on Netty. @@ -44,9 +44,9 @@ localS3.stop(); ``` -#### Run LocalS3 in Persistent mode +#### Run LocalS3 in Persistence mode -When a data directory is specified, LocalS3 tries to load data from and store all data in the path. +When a data directory is specified, LocalS3 tries to load data from and store all data into the path. ```java diff --git a/buildSrc/src/main/groovy/local-s3.java-conventions.gradle b/buildSrc/src/main/groovy/local-s3.java-conventions.gradle index a6832f6..de18542 100644 --- a/buildSrc/src/main/groovy/local-s3.java-conventions.gradle +++ b/buildSrc/src/main/groovy/local-s3.java-conventions.gradle @@ -32,7 +32,7 @@ repositories { } -project.group = 'com.robothy' +project.group = 'io.github.robothy' // Load version ext { diff --git a/buildSrc/src/main/groovy/local-s3.publish.gradle b/buildSrc/src/main/groovy/local-s3.publish.gradle index 4664294..3b9a7c5 100644 --- a/buildSrc/src/main/groovy/local-s3.publish.gradle +++ b/buildSrc/src/main/groovy/local-s3.publish.gradle @@ -17,6 +17,31 @@ publishing { groupId = group artifactId = project.name from components.java + + pom { + name = "LocalS3" + description 'An AmazonS3 service implementation.' + + licenses { + license { + name = 'The Apache License, Version 2.0' + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + + developers { + developer { + id = 'robothy' + name = "Fuxiang Luo" + email = "robothyluo@gmail.com" + } + } + + scm { + url = "https://github.com/Robothy/local-s3" + } + + } } } diff --git a/local-s3-docker/build.gradle b/local-s3-docker/build.gradle index 23bd8d6..3c75aa6 100644 --- a/local-s3-docker/build.gradle +++ b/local-s3-docker/build.gradle @@ -35,7 +35,7 @@ task dockerPush(type: Exec, dependsOn: dockerBuild) { doFirst { var cmd = new ArrayList(executor) cmd.add("docker push luofuxiang/local-s3:${project.version}") - //cmd.add("&& docker push ${DOCKER_HUB_USERNAME}/local-s3:latest") + cmd.add("&& docker push luofuxiang/local-s3:latest") commandLine(cmd) } } From 8fdfd03926a636830cb802a7bba80ab61281aa5f Mon Sep 17 00:00:00 2001 From: Fuxiang Luo Date: Tue, 8 Nov 2022 16:41:04 +0800 Subject: [PATCH 2/2] add MavenCentral requirements. --- .github/workflows/release.yml | 20 ++++++++++--- .../groovy/local-s3.java-conventions.gradle | 7 ----- .../src/main/groovy/local-s3.publish.gradle | 30 +++++++++++++++++-- .../src/main/resources/version.properties | 2 +- gradle.properties | 2 +- local-s3-rest/build.gradle | 5 +--- 6 files changed, 47 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b24109..5591c05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,22 +52,34 @@ jobs: mkdir -p ~/.gradle echo "GITHUB_TOKEN=${{secrets.PACKAGES_TOKEN}}" > ~/.gradle/gradle.properties echo "GITHUB_USERNAME=Robothy" >> ~/.gradle/gradle.properties + echo "signing.secretKey=${{ secrets.SING_SECRET_KEY }}" >> ~/.gradle/gradle.properties + echo "signing.password=${{ secrets.SING_PASSWORD }}" >> ~/.gradle/gradle.properties + echo "OSSRH_USERNAME=${{ secrets.OSSRH_USERNAME }}" >> ~/.gradle/gradle.properties + echo "OSSRH_PASSWORD=${{ secrets.OSSRH_PASSWORD }}" >> ~/.gradle/gradle.properties chmod +x gradlew pwd ls -l + - name: Update release version + run: | + ./gradlew releaseVersion + - name: Release if: ${{inputs.gradleLogLevel == 'None'}} - run: ./gradlew check release -Prelease=true + run: | + ./gradlew check release - name: Release(Info) if: ${{inputs.gradleLogLevel == 'Info'}} - run: ./gradlew check release -Prelease=true --info + run: .| + ./gradlew check release - name: Release(Debug) if: ${{inputs.gradleLogLevel == 'Debug'}} - run: ./gradlew check release -Prelease=true --debug + run: | + ./gradlew check release - name: Release(Stacktrace) if: ${{inputs.gradleLogLevel == 'Stacktrace'}} - run: ./gradlew check release -Prelease=true --stacktrace \ No newline at end of file + run: | + ./gradlew check release \ No newline at end of file diff --git a/buildSrc/src/main/groovy/local-s3.java-conventions.gradle b/buildSrc/src/main/groovy/local-s3.java-conventions.gradle index de18542..b6e5bca 100644 --- a/buildSrc/src/main/groovy/local-s3.java-conventions.gradle +++ b/buildSrc/src/main/groovy/local-s3.java-conventions.gradle @@ -7,13 +7,6 @@ repositories { mavenLocal() mavenCentral() jcenter() - maven { - url 'https://maven.pkg.github.com/robothy/netty-http-router' - credentials { - username = "${GITHUB_USERNAME}" - password = "${GITHUB_TOKEN}" - } - } maven { url 'https://maven.pkg.github.com/robothy-platform/maven' diff --git a/buildSrc/src/main/groovy/local-s3.publish.gradle b/buildSrc/src/main/groovy/local-s3.publish.gradle index 3b9a7c5..1aa5538 100644 --- a/buildSrc/src/main/groovy/local-s3.publish.gradle +++ b/buildSrc/src/main/groovy/local-s3.publish.gradle @@ -1,8 +1,11 @@ import io.franzbecker.gradle.lombok.task.DelombokTask +import java.nio.file.Files + plugins { id 'maven-publish' id 'io.franzbecker.gradle-lombok' + id 'signing' } java { @@ -20,7 +23,8 @@ publishing { pom { name = "LocalS3" - description 'An AmazonS3 service implementation.' + description = 'An AmazonS3 service implementation.' + url = 'https://github.com/Robothy/local-s3' licenses { license { @@ -38,7 +42,7 @@ publishing { } scm { - url = "https://github.com/Robothy/local-s3" + url = "https://github.com/Robothy/local-s3.git" } } @@ -58,6 +62,16 @@ publishing { password = project.findProperty("GITHUB_TOKEN") ?: System.getenv("GITHUB_TOKEN") } } + + maven { + name = "MavenCentral" + url = uri('https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/') + credentials { + username = findProperty("OSSRH_USERNAME") + password = findProperty("OSSRH_PASSWORD") + } + } + } } } @@ -77,4 +91,16 @@ javadoc { dependsOn delombok source = delombok.outputDir //failOnError = false +} + +signing { + def signingKey + if (findProperty("signingKeyRingFile") != null) { + signingKey = Files.readString(file(findProperty("signing.secretKeyRingFile")).toPath()) + } else { + signingKey = findProperty("signing.secretKey") + } + def signingPassword = findProperty("signing.password") + useInMemoryPgpKeys(signingKey, signingPassword) + sign publishing.publications.maven } \ No newline at end of file diff --git a/buildSrc/src/main/resources/version.properties b/buildSrc/src/main/resources/version.properties index 0a7fb38..e1de4ff 100644 --- a/buildSrc/src/main/resources/version.properties +++ b/buildSrc/src/main/resources/version.properties @@ -13,7 +13,7 @@ ch.qos.logback.logback-classic=1.2.3 com.huobi.sdk.huobi-client=v2.1.0 com.binance.api.binance-api-client=1.0.1 org.mock-server.mockserver-junit-jupiter=5.11.1 -com.robothy.netty-http-router=1.9 +com.robothy.netty-http-router=1.13 org.mockito.mockito-inline=3.4.0 cglib.cglib=3.1 org.projectlombok.lombok=1.18.18 diff --git a/gradle.properties b/gradle.properties index 1f6a225..34519aa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ version=1.2-SNAPSHOT -robothyPlatformReleaseGradlePluginVersion=2022.5 +robothyPlatformReleaseGradlePluginVersion=2022.6 org.gradle.parallel=false diff --git a/local-s3-rest/build.gradle b/local-s3-rest/build.gradle index 5f29791..bcb8b86 100644 --- a/local-s3-rest/build.gradle +++ b/local-s3-rest/build.gradle @@ -12,10 +12,7 @@ dependencies { implementation "org.apache.commons:commons-io:${libVersion['org.apache.commons.commons-io']}" implementation "org.apache.commons:commons-lang3:${libVersion['org.apache.commons.commons-lang3']}" implementation "org.apache.commons:commons-collections4:${libVersion['org.apache.commons.commons-collections4']}" - implementation ("com.robothy:netty-http-router:${libVersion['com.robothy.netty-http-router']}") { - exclude(group: 'org.slf4j', module: 'slf4j-simple') - exclude(group: 'org.projectlombok', module: 'lombok') - } + implementation ("io.github.robothy:netty-http-router:${libVersion['com.robothy.netty-http-router']}") testImplementation "org.mockito:mockito-inline:${libVersion['org.mockito.mockito-inline']}" } \ No newline at end of file