diff --git a/.github/workflows/fineract-client-publish.yml b/.github/workflows/fineract-client-publish.yml index aea00d6485..7146c46c8f 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 07f0069e94..e2548d4914 100644 --- a/build.gradle +++ b/build.gradle @@ -734,7 +734,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 @@ -772,7 +776,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')}"