From a1da9598bdc534c687826614caa802f5088ff7c4 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Fri, 2 Jul 2021 12:24:38 +0300 Subject: [PATCH] Update buildAndDeploy.yml 'read release' test for version 3.15.7 --- .github/workflows/buildAndDeploy.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index e06d815b73..4a7a40d65c 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -68,6 +68,20 @@ jobs: ./gradlew desktop:zipLinuxFilesForJar; mv desktop/build/libs/Unciv.jar deploy/Unciv.jar + - name: Read release.md and use it as a body of new release + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + id: read_release + shell: bash + run: | + r=$(cat path/to/release.md) # <--- Read release.md (Provide correct path as per your repo) + r=$(grep -Pzo --color '\\#{2}.3.15.7\([^\\#]*?\\#{2}\)') # grep to get only our release + echo "$r" + r="${r//'%'/'%25'}" # Multiline escape sequences for % + r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n' + r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r' + echo "::set-output name=RELEASE_BODY::$r" # <--- Set environment variable + + - name: Upload binaries to release if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')