From 02c1a7cc4db1a9f24d9a2af88b255cff80e8584a Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Wed, 13 Dec 2023 15:56:42 +0300 Subject: [PATCH] Fixed release.yml (#1861) - added calculating version from tag ref - added `shadowExecutableJar` for GitHub release --- .github/workflows/release.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fcb75e56aa..bbef86b078 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,10 @@ jobs: java-version: 11 distribution: temurin + - name: 'Calculate the release version' + run: | + echo "RELEASE_VERSION=${GITHUB_REF#'refs/tags/v'}" >> $GITHUB_ENV + - name: 'Publish a release to Maven Central' id: publish-sonatype uses: gradle/gradle-build-action@v2 @@ -58,13 +62,14 @@ jobs: with: gradle-version: wrapper arguments: | + shadowExecutableJar publishAllPublicationsToGitHubRepository - name: 'GitHub Release' id: create_release uses: actions/create-release@v1 with: tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} + release_name: Release ${{ env.RELEASE_VERSION }} draft: false prerelease: false - name: Upload Diktat CLI to GitHub release @@ -74,7 +79,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./diktat-cli/build/diktat-cli-${{ github.ref }} + asset_path: ./diktat-cli/build/diktat-cli-${{ env.RELEASE_VERSION }} asset_name: diktat asset_content_type: application/zip - name: Upload Diktat CLI for Windows to GitHub release @@ -94,6 +99,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./diktat-ruleset/build/libs/diktat-${{ github.ref }}.jar - asset_name: diktat-${{ github.ref }}.jar + asset_path: ./diktat-ruleset/build/libs/diktat-${{ env.RELEASE_VERSION }}.jar + asset_name: diktat-${{ env.RELEASE_VERSION }}.jar asset_content_type: application/zip