Skip to content

Commit

Permalink
rel: release v0.1.0
Browse files Browse the repository at this point in the history
Signed-off-by: grapebaba <281165273@qq.com>
  • Loading branch information
GrapeBaBa committed Nov 21, 2022
1 parent acc7b5d commit b78ffee
Show file tree
Hide file tree
Showing 10 changed files with 228 additions and 134 deletions.
43 changes: 34 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,54 @@ on:
release:
types: [created]
jobs:
publish:
sonatype-publish:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_TOKEN }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SIGN_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_SIGN_PW }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Publish package
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository


github-publish:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SIGN_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_SIGN_PW }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Execute Gradle build
run: ./gradlew build

- name: Publish package
run: ./gradlew publish
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew publishAllPublicationsToGitHubPackagesRepository
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![sui4j CI](https://github.com/GrapeBaBa/sui4j/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/GrapeBaBa/sui4j/actions/workflows/gradle.yml)
[![sui4j CI](https://github.com/GrapeBaBa/sui4j/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/GrapeBaBa/sui4j/actions/workflows/build.yml)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
![Coverage](.github/badges/jacoco.svg)
![Branches](.github/badges/branches.svg)
Expand Down
36 changes: 23 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ plugins {
id "com.diffplug.spotless" version "6.11.0"
id 'org.unbroken-dome.test-sets' version '4.0.0'
id 'maven-publish'
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
id 'signing'
}


group 'io.sui'
version '0.1.0-SNAPSHOT'
group 'me.grapebaba'
version '0.1.4'

repositories {
mavenCentral()
Expand Down Expand Up @@ -203,17 +204,17 @@ publishing {
}
}
repositories {
maven {
name = "OSSRH"
// change URLs to point to your repos, e.g. http://my.org/repo
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
// maven {
// name = "OSSRH"
// // change URLs to point to your repos, e.g. http://my.org/repo
// def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
// def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
// url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
// credentials {
// username = System.getenv("MAVEN_USERNAME")
// password = System.getenv("MAVEN_PASSWORD")
// }
// }
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/GrapeBaBa/" + rootProject.name
Expand All @@ -227,6 +228,9 @@ publishing {

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


Expand All @@ -235,3 +239,9 @@ javadoc {
options.addBooleanOption('html5', true)
}
}

nexusPublishing {
repositories {
sonatype()
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
signing.keyId=1AF5DF33
# Gradle
#org.gradle.jvmargs=--add-opens java.base/java.lang=ALL-UNNAMED
# Versions
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit b78ffee

Please sign in to comment.