Skip to content

Commit

Permalink
Fixed release.yml (#1861)
Browse files Browse the repository at this point in the history
- added calculating version from tag ref
- added `shadowExecutableJar` for GitHub release
  • Loading branch information
nulls authored Dec 13, 2023
1 parent c047d84 commit 02c1a7c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 02c1a7c

Please sign in to comment.