From 5f4ae1efc82739e322093c3e7218e0e0241c82c1 Mon Sep 17 00:00:00 2001 From: Ashutosh Gangwar Date: Wed, 6 Jul 2022 11:08:47 +0530 Subject: [PATCH] add github release job to the api github workflow --- .github/workflows/api.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/api.yaml b/.github/workflows/api.yaml index f2df8d1..f3a90b3 100644 --- a/.github/workflows/api.yaml +++ b/.github/workflows/api.yaml @@ -29,6 +29,30 @@ jobs: - run: ./gradlew check --no-daemon - uses: codecov/codecov-action@v2 + github-release: + name: GitHub Release + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + needs: tests + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v3 + - run: git fetch --prune --unshallow --tags -f + - id: tag_info + run: | + export TAG_NAME="${GITHUB_REF/'refs/tags/'/''}" + export TAG_BODY="$(git tag --list --format='%(contents:body)' $TAG_NAME)" + export TAG_BODY="${TAG_BODY//'%'/'%25'}" + export TAG_BODY="${TAG_BODY//$'\n'/'%0A'}" + export TAG_BODY="${TAG_BODY//$'\r'/'%0D'}" + echo "::set-output name=name::${TAG_NAME}" + echo "::set-output name=body::${TAG_BODY}" + - uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.BOT_PAT }} + name: ${{ steps.tag_info.outputs.name }} + body: ${{ steps.tag_info.outputs.body }} + deploy: name: Deploy if: github.event_name == 'push'