From 33506ed3bec3bd80a5bd46a55ebeb024cf4dcdfd Mon Sep 17 00:00:00 2001 From: "giorgi.mania" Date: Fri, 16 Sep 2022 13:35:07 +0400 Subject: [PATCH] [TH2-4210] Add commit hash in dev build releases --- .../workflows/dev-java-publish-sonatype.yml | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dev-java-publish-sonatype.yml b/.github/workflows/dev-java-publish-sonatype.yml index 01f94879..c654dba7 100644 --- a/.github/workflows/dev-java-publish-sonatype.yml +++ b/.github/workflows/dev-java-publish-sonatype.yml @@ -1,12 +1,12 @@ -name: Dev build and publish Java distributions to sonatype snapshot repository +name: Dev build and publish Docker distributions to Github Container Registry ghcr.io on: push: branches-ignore: - - master - - version-* - # paths: - # - gradle.properties + - master + - version-* +# paths: +# - gradle.properties jobs: build: @@ -14,10 +14,13 @@ jobs: steps: - uses: actions/checkout@v2 -# Prepare custom build version + # Prepare custom build version - name: Get branch name id: branch run: echo ::set-output name=branch_name::${GITHUB_REF#refs/*/} + - name: Get SHA of the commit + id: sha + run: echo ::set-output name=sha_short::$(git rev-parse --short HEAD) - name: Get release_version id: ver uses: christian-draeger/read-properties@1.0.1 @@ -26,7 +29,7 @@ jobs: property: release_version - name: Build custom release version id: release_ver - run: echo ::set-output name=value::"${{ steps.ver.outputs.value }}-${{ steps.branch.outputs.branch_name }}-${{ github.run_id }}-SNAPSHOT" + run: echo ::set-output name=value::"${{ steps.ver.outputs.value }}-${{ steps.branch.outputs.branch_name }}-${{ github.run_id }}-${{ steps.sha.outputs.sha_short }}-SNAPSHOT" - name: Write custom release version to file uses: christian-draeger/write-properties@1.0.1 with: @@ -35,7 +38,7 @@ jobs: value: ${{ steps.release_ver.outputs.value }} - name: Show custom release version run: echo ${{ steps.release_ver.outputs.value }} -# Build and publish package + # Build and publish package - name: Set up JDK 11 uses: actions/setup-java@v1 with: @@ -46,5 +49,4 @@ jobs: ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }} - ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }} - + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}