chore(release): version packages #19
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Announce fetch-kit Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| announce: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Post release to Discord | |
| run: | | |
| TAG=${GITHUB_REF#refs/tags/} # e.g., v4.0.8 | |
| VERSION=${TAG#v} # remove 'v' to match changelog headers | |
| # Extract changelog block for this version | |
| NOTES=$(sed -n "/^## $VERSION$/,/^## /{ /^## /!p }" CHANGELOG.md | sed '/^[[:space:]]*$/d') | |
| if [ -z "$NOTES" ]; then | |
| NOTES="(no changelog entry found for $VERSION)" | |
| fi | |
| # Construct JSON with jq, preserving literal line breaks | |
| PAYLOAD=$(jq -Rn --arg tag "$TAG" --arg repo "$GITHUB_REPOSITORY" --arg notes "$NOTES" \ | |
| '{content: ("**New fetch-kit Release**\nRepository: \($repo) - version: \($tag)\n```\n\($notes)\n```")}') | |
| # Send to Discord webhook | |
| curl -sS -H "Content-Type: application/json" -X POST -d "$PAYLOAD" ${{ secrets.DISCORD_WEBHOOK }} |