chore(release): bump version to 3.20.46 #401
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: Create GitHub Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Extract CHANGELOG section | |
| id: changelog | |
| run: | | |
| VERSION="${GITHUB_REF#refs/tags/v}" | |
| BODY=$(awk "/^## \[$VERSION\]/,/^## \[/" CHANGELOG.md | sed '$d') | |
| PREV_TAG=$(git describe --tags --abbrev=0 "v$VERSION^" 2>/dev/null || echo '') | |
| if [ -n "$PREV_TAG" ]; then | |
| EXTRA=$(git log --oneline "$PREV_TAG..v$VERSION" -- | grep -v 'chore: claim t' | head -10) | |
| BODY="$BODY"$'\n\n### Commits since CHANGELOG generation\n'"$EXTRA" | |
| fi | |
| { | |
| echo "body<<DELIM" | |
| echo "$BODY" | |
| echo "DELIM" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Create release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then | |
| echo "Release $GITHUB_REF_NAME already exists; updating metadata" | |
| gh release edit "$GITHUB_REF_NAME" \ | |
| --title "$GITHUB_REF_NAME" \ | |
| --notes "${{ steps.changelog.outputs.body }}" | |
| else | |
| if gh release create "$GITHUB_REF_NAME" \ | |
| --title "$GITHUB_REF_NAME" \ | |
| --notes "${{ steps.changelog.outputs.body }}"; then | |
| echo "Release $GITHUB_REF_NAME created" | |
| elif gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then | |
| echo "Release $GITHUB_REF_NAME appeared after create failed; updating metadata" | |
| gh release edit "$GITHUB_REF_NAME" \ | |
| --title "$GITHUB_REF_NAME" \ | |
| --notes "${{ steps.changelog.outputs.body }}" | |
| else | |
| exit 1 | |
| fi | |
| fi |