Skip to content

Added pypi publishing workflow. #1

Added pypi publishing workflow.

Added pypi publishing workflow. #1

Workflow file for this run

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 }}