Skip to content

Increment Version and Push #7

Increment Version and Push

Increment Version and Push #7

Workflow file for this run

name: Bump version
on:
workflow_dispatch:
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Bump version
id: bump_version
run: |
VERSION=$(python -c "import toml; pyproject = toml.load('pyproject.toml'); version = pyproject['tool']['poetry']['version'].split('.'); version[2] = str(int(version[2]) + 1); print('.'.join(version))")
echo "New version: $VERSION"
sed -i "s/version = \".*\"/version = \"$VERSION\"/" pyproject.toml
echo "::set-output name=VERSION::$VERSION"
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add pyproject.toml
git commit -m "Bump version to ${{ steps.bump_version.outputs.VERSION }}"
git push origin main