Skip to content

Release v0.58.0

Release v0.58.0 #149

Workflow file for this run

name: Update Changelog
on:
push:
branches:
- master
jobs:
update-changelog:
runs-on: ubuntu-latest
env:
version:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get the current version
id: current-version
run: echo "version=$(python setup.py --version)" >> $GITHUB_ENV
- name: Check if the commit message matches the release pattern
run: |
if [[ $(git log -1 --pretty=%B) != "Update changelog for v${{ env.version }}" ]]; then
echo "Commit message does not match the release pattern."
exit 1
fi
- name: Update changelog
if: contains(github.event.head_commit.message, 'Update changelog for v${{ env.version }}')
run: |
PREVIOUS_VERSION=$(git tag -l --sort=-creatordate | head -n 1)
CHANGES=$(git log --pretty=format:"- %s (%h)" $PREVIOUS_VERSION..)
echo "# v${{ env.version }}" >> CHANGELOG.md
echo "## Changes" >> CHANGELOG.md
echo "$CHANGES" >> CHANGELOG.md
git config user.email "[email protected]"
git config user.name "Md. Musfiqur Rahaman"
git commit -am "Update CHANGELOG.md with latest version by GitHub Action"
git push