Skip to content

Commit

Permalink
Update and simplify the release GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
plamentotev committed Sep 28, 2024
1 parent d43e9d5 commit 09889f2
Showing 1 changed file with 9 additions and 45 deletions.
54 changes: 9 additions & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,22 @@ jobs:
release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Get tag name
id: get_tag
uses: actions/github-script@master
with:
result-encoding: string
script: return '${{ github.ref }}'.replace('refs/tags/', '');

- name: Get release version
id: get_version
uses: actions/github-script@master
with:
result-encoding: string
script: return '${{ steps.get_tag.outputs.result }}'.substr(1);

- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
distribution: 'temurin'
java-version: '21'

- name: Build project
run: ./gradlew --no-daemon --console=plain build

- name: Create release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_tag.outputs.result }}
release_name: ${{ steps.get_tag.outputs.result }}
draft: false
prerelease: false

- name: Upload the TAR archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/distributions/xvalid.tar
asset_name: xvalid-${{ steps.get_version.outputs.result }}.tar
asset_content_type: application/tar
- name: Upload the ZIP archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/distributions/xvalid.zip
asset_name: xvalid-${{ steps.get_version.outputs.result }}.zip
asset_content_type: application/zip
run: gh release create --title '${{ github.ref_name }}' --notes-from-tag --draft '${{ github.ref_name }}' ./build/distributions/xvalid.tar ./build/distributions/xvalid.zip

0 comments on commit 09889f2

Please sign in to comment.