Skip to content

Commit

Permalink
add github release job to the api github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutoshgngwr committed Jul 6, 2022
1 parent ae66f13 commit 5f4ae1e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 5f4ae1e

Please sign in to comment.