diff --git a/.github/artifactory-init.gradle b/.github/artifactory-init.gradle deleted file mode 100644 index a6a5693..0000000 --- a/.github/artifactory-init.gradle +++ /dev/null @@ -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) - } - } -} \ No newline at end of file diff --git a/.github/spring-project-init.gradle b/.github/spring-project-init.gradle new file mode 100644 index 0000000..e8a7144 --- /dev/null +++ b/.github/spring-project-init.gradle @@ -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 + } + } + } + } +} \ No newline at end of file diff --git a/.github/workflows/spring-artifactory-gradle-release-staging.yml b/.github/workflows/spring-artifactory-gradle-release-staging.yml index 390433c..c948042 100644 --- a/.github/workflows/spring-artifactory-gradle-release-staging.yml +++ b/.github/workflows/spring-artifactory-gradle-release-staging.yml @@ -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 diff --git a/.github/workflows/spring-artifactory-gradle-snapshot.yml b/.github/workflows/spring-artifactory-gradle-snapshot.yml index 8bf953d..11e3375 100644 --- a/.github/workflows/spring-artifactory-gradle-snapshot.yml +++ b/.github/workflows/spring-artifactory-gradle-snapshot.yml @@ -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 diff --git a/build.gradle b/build.gradle index 0d372b1..a5d44d8 100644 --- a/build.gradle +++ b/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"