From cd2eb824cf8738ed6b60186d963df8b06302516f Mon Sep 17 00:00:00 2001 From: Arnold Galovics Date: Thu, 26 Jan 2023 09:10:12 +0100 Subject: [PATCH] Added incremental build number generation for client and avro schema publication --- .github/workflows/fineract-client-publish.yml | 8 ++++++-- build.gradle | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fineract-client-publish.yml b/.github/workflows/fineract-client-publish.yml index aea00d64852..7146c46c8f2 100644 --- a/.github/workflows/fineract-client-publish.yml +++ b/.github/workflows/fineract-client-publish.yml @@ -6,7 +6,7 @@ on: - develop permissions: - contents: read + contents: write jobs: build: @@ -17,6 +17,10 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Generate build number + uses: onyxmueller/build-tag-number@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: Set up JDK 17 uses: actions/setup-java@v3 with: @@ -24,4 +28,4 @@ jobs: distribution: 'zulu' cache: gradle - name: Build the image - run: ./gradlew publish -Pfineract.config.username=$ARTIFACTORY_USERNAME -Pfineract.config.password=$ARTIFACTORY_PASSWORD + run: ./gradlew publish -Pfineract.config.username=$ARTIFACTORY_USERNAME -Pfineract.config.password=$ARTIFACTORY_PASSWORD -Pfineract.release.version=${BUILD_NUMBER} diff --git a/build.gradle b/build.gradle index 9c57d606815..edf9d6d2d23 100644 --- a/build.gradle +++ b/build.gradle @@ -737,7 +737,11 @@ configure(project.fineractPublishProjects) { mavenJava(MavenPublication) { groupId 'org.apache.fineract' artifactId project.name - version "${project.version}-SNAPSHOT" + if (project.hasProperty('fineract.release.version')) { + version "${project.version}" + } else { + version "${project.version}-SNAPSHOT" + } from components.java @@ -775,7 +779,7 @@ configure(project.fineractPublishProjects) { maven { name 'mifos' - url hasProperty('fineract.release.version') ? releaseUrl : stagingUrl + url project.hasProperty('fineract.release.version') ? releaseUrl : stagingUrl credentials { username "${findProperty('fineract.config.username')}" password "${findProperty('fineract.config.password')}"