Some workflows improvements
* Move `nextDevelopmentVersion` Gradle task to the `spring-project-init.gradle` * Checkout common repo to the `build` dir which is then cleaned by Gradle
This commit is contained in:
23
.github/artifactory-init.gradle
vendored
23
.github/artifactory-init.gradle
vendored
@@ -1,23 +0,0 @@
|
||||
gradle.projectsLoaded {
|
||||
rootProject {
|
||||
artifactory {
|
||||
publish {
|
||||
defaults {
|
||||
def zipArtifactProps =
|
||||
['zip.name': 'spring-integration-aws',
|
||||
'zip.displayname': 'Spring Integration Aws',
|
||||
'zip.deployed': 'false']
|
||||
properties {
|
||||
mavenJava zipArtifactProps, '*:*:*:*@zip'
|
||||
mavenJava 'zip.type': 'docs', '*:*:*:docs@zip'
|
||||
mavenJava 'zip.type': 'dist', '*:*:*:dist@zip'
|
||||
}
|
||||
|
||||
publications('mavenJava')
|
||||
}
|
||||
forkCount = 10
|
||||
}
|
||||
clientConfig.setConnectionRetries(4)
|
||||
}
|
||||
}
|
||||
}
|
||||
47
.github/spring-project-init.gradle
vendored
Normal file
47
.github/spring-project-init.gradle
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
gradle.projectsLoaded {
|
||||
rootProject {
|
||||
// JFrog's build-info-extractor-gradle adds Gradle init script which does `apply plugin: ArtifactoryPlugin`
|
||||
artifactory {
|
||||
publish {
|
||||
defaults {
|
||||
def zipArtifactProps =
|
||||
['zip.name': 'spring-integration-aws',
|
||||
'zip.displayname': 'Spring Integration Aws',
|
||||
'zip.deployed': 'false']
|
||||
properties {
|
||||
mavenJava zipArtifactProps, '*:*:*:*@zip'
|
||||
mavenJava 'zip.type': 'docs', '*:*:*:docs@zip'
|
||||
mavenJava 'zip.type': 'dist', '*:*:*:dist@zip'
|
||||
}
|
||||
|
||||
publications('mavenJava')
|
||||
}
|
||||
forkCount = 10
|
||||
}
|
||||
clientConfig.setConnectionRetries(4)
|
||||
}
|
||||
|
||||
// No need to have this task in project: only when we perform GHA
|
||||
tasks.register('nextDevelopmentVersion') {
|
||||
doLast {
|
||||
if (!project.version.endsWith('-SNAPSHOT')) {
|
||||
String nextDevelopmentVersion
|
||||
if (project.version.contains('-M') || project.version.contains('-RC')) {
|
||||
nextDevelopmentVersion = project.version - ~/(M|RC)\d+/ + 'SNAPSHOT'
|
||||
}
|
||||
else {
|
||||
def versionParts = project.version.tokenize('.')
|
||||
def major = versionParts[0]
|
||||
def minor = versionParts[1]
|
||||
def patch = versionParts[2] as int
|
||||
nextDevelopmentVersion = major + '.' + minor + '.' + (++patch)+ '-SNAPSHOT'
|
||||
}
|
||||
|
||||
def gradleProperties = file('gradle.properties')
|
||||
def newProps = gradleProperties.text.replace(project.version, nextDevelopmentVersion)
|
||||
gradleProperties.text = newProps
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,11 +35,11 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: spring-projects/spring-integration-aws
|
||||
path: init
|
||||
path: build
|
||||
show-progress: false
|
||||
|
||||
- name: Copy the artifactory-init.gradle
|
||||
run: rsync init/.github/artifactory-init.gradle ~/.gradle/init.d/
|
||||
- name: Copy the spring-project-init.gradle
|
||||
run: rsync build/.github/spring-project-init.gradle ~/.gradle/init.d/
|
||||
|
||||
- uses: jfrog/setup-jfrog-cli@v3
|
||||
with:
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
|
||||
- name: Build and Publish
|
||||
run: |
|
||||
jf gradle build ${{ inputs.gradleTasks }} artifactoryPublish
|
||||
jf gradle clean build ${{ inputs.gradleTasks }} artifactoryPublish
|
||||
jf rt build-publish
|
||||
|
||||
- name: Tag Release and Next Development Version
|
||||
|
||||
@@ -31,11 +31,11 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: spring-projects/spring-integration-aws
|
||||
path: init
|
||||
path: build
|
||||
show-progress: false
|
||||
|
||||
- name: Copy the artifactory-init.gradle
|
||||
run: rsync init/.github/artifactory-init.gradle ~/.gradle/init.d/
|
||||
- name: Copy the spring-project-init.gradle
|
||||
run: rsync build/.github/spring-project-init.gradle ~/.gradle/init.d/
|
||||
|
||||
- uses: jfrog/setup-jfrog-cli@v3
|
||||
with:
|
||||
@@ -53,6 +53,6 @@ jobs:
|
||||
|
||||
- name: Build and Publish
|
||||
run: |
|
||||
jf gradle build ${{ inputs.gradleTasks }} artifactoryPublish
|
||||
jf gradle clean build ${{ inputs.gradleTasks }} artifactoryPublish
|
||||
jf rt build-publish
|
||||
|
||||
|
||||
23
build.gradle
23
build.gradle
@@ -276,27 +276,4 @@ task dist(dependsOn: assemble) {
|
||||
description = 'Builds -dist and -docs distribution archives.'
|
||||
}
|
||||
|
||||
tasks.register('nextDevelopmentVersion') {
|
||||
onlyIf { isCI }
|
||||
doLast {
|
||||
if (!project.version.endsWith('-SNAPSHOT')) {
|
||||
String nextDevelopmentVersion
|
||||
if (project.version.contains('-M') || project.version.contains('-RC')) {
|
||||
nextDevelopmentVersion = project.version - ~/(M|RC)\d+/ + 'SNAPSHOT'
|
||||
}
|
||||
else {
|
||||
def versionParts = project.version.tokenize('.')
|
||||
def major = versionParts[0]
|
||||
def minor = versionParts[1]
|
||||
def patch = versionParts[2] as int
|
||||
nextDevelopmentVersion = major + '.' + minor + '.' + (++patch)+ '-SNAPSHOT'
|
||||
}
|
||||
|
||||
def gradleProperties = file('gradle.properties')
|
||||
def newProps = gradleProperties.text.replace(project.version, nextDevelopmentVersion)
|
||||
gradleProperties.text = newProps
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apply from: "${rootProject.projectDir}/publish-maven.gradle"
|
||||
|
||||
Reference in New Issue
Block a user