From b8fabde838b06c9c34f942da93d7940aa3d294b3 Mon Sep 17 00:00:00 2001 From: Cuh4 <89425262+Cuh4@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:35:00 +0100 Subject: [PATCH] add support for description --- .github/workflows/auto-release.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 246e11d..8dfce1b 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -23,34 +23,41 @@ jobs: id: get_commit_message run: echo "::set-output name=message::$(git log -1 --pretty=%B)" - - name: Extract version from commit message - id: extract_version + - name: Extract version and description from commit message + id: extract_details run: | - if [[ "${{ steps.get_commit_message.outputs.message }}" =~ Release[[:space:]]-[[:space:]]([0-9]+\.[0-9]+\.[0-9]+) ]]; then - echo "::set-output name=version::${BASH_REMATCH[1]}" + message="${{ steps.get_commit_message.outputs.message }}" + if [[ "$message" =~ RELEASE[[:space:]]-[[:space:]]([0-9]+\.[0-9]+\.[0-9]+) ]]; then + version="${BASH_REMATCH[1]}" + description="${message/RELEASE - $version/}" + echo "::set-output name=version::$version" + echo "::set-output name=description::$description" fi - name: Create GitHub Release id: create_release - if: steps.extract_version.outputs.version != '' + if: steps.extract_details.outputs.version != '' uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ steps.extract_version.outputs.version }} - release_name: Noir ${{ steps.extract_version.outputs.version }} + tag_name: ${{ steps.extract_details.outputs.version }} + release_name: ${{ steps.extract_details.outputs.version }} body: | # 📚 Details - **Version:** `${{ steps.extract_version.outputs.version }}` + **Version:** `${{ steps.extract_details.outputs.version }}` # ❔ Installation Check out the [documentation](https://cuhhub.gitbook.io/noir) for information on how to install and use Noir in your addon. + + # 📝 Description + ${{ steps.extract_details.outputs.description }} draft: false prerelease: false - name: Upload release asset id: upload_release_asset - if: steps.extract_version.outputs.version != '' + if: steps.extract_details.outputs.version != '' uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}