Update mbn to v1.0.21. #12
This file contains 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: Bump-Version | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
bump-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install bump2version | |
- name: Configure Git Identity | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "actions@github.com" | |
- name: Determine version bump | |
id: determine_bump | |
run: | | |
COMMIT_MSG=$(git log -1 --pretty=%B) | |
echo "Commit message: $COMMIT_MSG" | |
if [[ "$COMMIT_MSG" == *"#major"* ]]; then | |
echo "bump_type=major" >> $GITHUB_ENV | |
elif [[ "$COMMIT_MSG" == *"#minor"* ]]; then | |
echo "bump_type=minor" >> $GITHUB_ENV | |
else | |
echo "bump_type=patch" >> $GITHUB_ENV | |
fi | |
- name: Bump the version | |
run: | | |
bump2version ${{ env.bump_type }} | |
- name: Push changes | |
run: git push origin main --tags | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |