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'