Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add publish to Maven central requirements. #2

Merged
merged 2 commits into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: |
./gradlew check release
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
9 changes: 1 addition & 8 deletions buildSrc/src/main/groovy/local-s3.java-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -32,7 +25,7 @@ repositories {

}

project.group = 'com.robothy'
project.group = 'io.github.robothy'

// Load version
ext {
Expand Down
51 changes: 51 additions & 0 deletions buildSrc/src/main/groovy/local-s3.publish.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -17,6 +20,32 @@ publishing {
groupId = group
artifactId = project.name
from components.java

pom {
name = "LocalS3"
description = 'An AmazonS3 service implementation.'
url = 'https://github.com/Robothy/local-s3'

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.git"
}

}
}
}

Expand All @@ -33,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")
}
}

}
}
}
Expand All @@ -52,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
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/resources/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version=1.2-SNAPSHOT
robothyPlatformReleaseGradlePluginVersion=2022.5
robothyPlatformReleaseGradlePluginVersion=2022.6
org.gradle.parallel=false
2 changes: 1 addition & 1 deletion local-s3-docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
5 changes: 1 addition & 4 deletions local-s3-rest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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']}"
}