Skip to content

Commit 5f4ae1e

Browse files
committed
add github release job to the api github workflow
1 parent ae66f13 commit 5f4ae1e

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/api.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,30 @@ jobs:
2929
- run: ./gradlew check --no-daemon
3030
- uses: codecov/codecov-action@v2
3131

32+
github-release:
33+
name: GitHub Release
34+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
35+
needs: tests
36+
runs-on: ubuntu-latest
37+
timeout-minutes: 10
38+
steps:
39+
- uses: actions/checkout@v3
40+
- run: git fetch --prune --unshallow --tags -f
41+
- id: tag_info
42+
run: |
43+
export TAG_NAME="${GITHUB_REF/'refs/tags/'/''}"
44+
export TAG_BODY="$(git tag --list --format='%(contents:body)' $TAG_NAME)"
45+
export TAG_BODY="${TAG_BODY//'%'/'%25'}"
46+
export TAG_BODY="${TAG_BODY//$'\n'/'%0A'}"
47+
export TAG_BODY="${TAG_BODY//$'\r'/'%0D'}"
48+
echo "::set-output name=name::${TAG_NAME}"
49+
echo "::set-output name=body::${TAG_BODY}"
50+
- uses: softprops/action-gh-release@v1
51+
with:
52+
token: ${{ secrets.BOT_PAT }}
53+
name: ${{ steps.tag_info.outputs.name }}
54+
body: ${{ steps.tag_info.outputs.body }}
55+
3256
deploy:
3357
name: Deploy
3458
if: github.event_name == 'push'

0 commit comments

Comments
 (0)