docs: add v5.1.1 changelog entry (case normalization fix) #3
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: release | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'package.json' | |
| - 'CHANGELOG.md' | |
| permissions: | |
| contents: write | |
| jobs: | |
| tag-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Extract version from package.json | |
| id: version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Check if tag already exists | |
| id: check | |
| run: | | |
| if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then | |
| echo "exists=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "exists=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Extract release notes from CHANGELOG.md | |
| if: steps.check.outputs.exists == 'false' | |
| id: notes | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| awk -v ver="## $VERSION" ' | |
| $0 == ver {found=1; next} | |
| found && /^## / {exit} | |
| found {print} | |
| ' CHANGELOG.md > release_notes.txt | |
| { | |
| echo 'notes<<EOF' | |
| cat release_notes.txt | |
| echo EOF | |
| } >> $GITHUB_OUTPUT | |
| - name: Create tag and GitHub release | |
| if: steps.check.outputs.exists == 'false' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.version.outputs.version }} | |
| name: v${{ steps.version.outputs.version }} | |
| body: ${{ steps.notes.outputs.notes }} | |
| draft: false | |
| prerelease: false |