diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac6a0b2..b76a0ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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/create-release@v1.1.4 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