Skip to content

Commit

Permalink
升级发布仓库配置
Browse files Browse the repository at this point in the history
  • Loading branch information
qmdx committed Aug 1, 2024
1 parent bcf12ee commit 9cb345c
Show file tree
Hide file tree
Showing 7 changed files with 228 additions and 211 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/gradle.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@ jobs:
- name: Build without tests
run: ./gradlew build -x test

- name: Decode
run: |
echo "${{secrets.SIGNING_SECRET_KEY_RING_FILE}}" > ~/.gradle/secring.gpg.b64
base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg
- name: Publish
run: ./gradlew publish -Psigning.keyId=${{secrets.SIGNING_KEY_ID}} -Psigning.password=${{secrets.SIGNING_PASSWORD}} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg)
- name: Publish package to maven central
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
run: ./gradlew publishAllPublicationsToMavenCentralRepository
77 changes: 5 additions & 72 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,29 @@ buildscript {
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/spring' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://repo.spring.io/release' }
maven { url 'https://repo.spring.io/milestone' }
mavenCentral()
}

dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("com.vanniktech:gradle-maven-publish-plugin:0.29.0")
}
}

description = "FlowLong BPM"

// 项目配置
allprojects {
group "com.aizuda"
version "0.0.11"
group APP_GROUP
version APP_VERSION
}


// 子模块配置
subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'com.vanniktech.maven.publish'
apply plugin: 'signing'
apply plugin: "io.spring.dependency-management"
apply plugin: 'io.spring.dependency-management'

tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:-serial"
Expand All @@ -54,9 +52,6 @@ subprojects {
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/spring' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://repo.spring.io/release' }
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
mavenCentral()
}
Expand Down Expand Up @@ -139,68 +134,6 @@ subprojects {
from javadoc
}

tasks.configureEach { task ->
if (task.name.contains('signMavenJavaPublication')) {
task.enabled = new File(project.property('signing.secretKeyRingFile') as String).isFile()
}
}

signing {
sign publishing.publications
}

publishing {
repositories {
maven {
name = "OSSRH"
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")
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java

artifact sourcesJar
artifact javadocJar

pom {
name = 'flowlong'
packaging 'jar'
description = 'flowlong bpm engine'
url = 'https://github.com/aizuda/flowlong'

scm {
connection = 'scm:[email protected]:Codearte/gradle-nexus-staging-plugin.git'
developerConnection = 'scm:[email protected]:Codearte/gradle-nexus-staging-plugin.git'
url = 'https://github.com/aizuda/flowlong'
}

licenses {
license {
name = 'The AGPL License, Version 3.0'
url = 'https://www.gnu.org/licenses/agpl-3.0'
}
}

developers {
developer {
id = 'aizuda'
name = '青苗'
email = '[email protected]'
}
}
}
}
}
}

// 编译任务忽略案例模块
afterEvaluate { project ->
if (project.name == 'flowlong-spring-boot-example') {
Expand Down
26 changes: 22 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
signing.keyId=1FD337F9
signing.password=243194995
signing.secretKeyRingFile=C:/signing.gpg
local=true
APP_GROUP=com.aizuda
APP_VERSION=0.0.11

SONATYPE_HOST=CENTRAL_PORTAL
RELEASE_SIGNING_ENABLED=true

POM_NAME=flowlong
POM_DESCRIPTION=flowlong bpm engine
POM_INCEPTION_YEAR=2024
POM_URL=https://github.com/aizuda/flowlong/

POM_LICENSE_NAME=The AGPL License, Version 3.0
POM_LICENSE_URL=https://www.gnu.org/licenses/agpl-3.0
POM_LICENSE_DIST=repo

POM_SCM_URL=https://github.com/aizuda/flowlong/
POM_SCM_CONNECTION=scm:git:git://github.com/aizuda/flowlong.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/aizuda/flowlong.git

POM_DEVELOPER_ID[email protected]
POM_DEVELOPER_NAME=Jobob
POM_DEVELOPER_URL=https://github.com/aizuda/flowlong
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-7.6-bin.zip
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 9cb345c

Please sign in to comment.