Skip to content

Bump Version

Bump Version #2

Workflow file for this run

name: Bump Version
on:
workflow_dispatch:
inputs:
version_part:
description: 'Version part to bump (major, minor, patch)'
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch
jobs:
bump-version:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install bumpversion
run: |
python -m pip install --upgrade pip
pip install bump2version
- name: Configure git
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Get current version
id: current_version
run: |
version=$(grep '^current_version' .bumpversion.cfg | cut -d '=' -f 2 | tr -d ' ')
echo "version=${version}" >> "$GITHUB_OUTPUT"
- name: Bump version
id: bump_version
run: |
# Use --no-tag to prevent creating a tag (we'll tag after PR merge)
# Use --no-commit to let create-pull-request handle the commit
bump2version ${{ github.event.inputs.version_part }} --no-tag --no-commit
new_version=$(grep '^current_version' .bumpversion.cfg | cut -d '=' -f 2 | tr -d ' ')
echo "new_version=${new_version}" >> "$GITHUB_OUTPUT"
- name: Create Pull Request
id: create_pr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: bump version from ${{ steps.current_version.outputs.version }} to ${{ steps.bump_version.outputs.new_version }}"
title: "chore: bump version from ${{ steps.current_version.outputs.version }} to ${{ steps.bump_version.outputs.new_version }}"
body: |
## Version Bump
This PR bumps the version from `${{ steps.current_version.outputs.version }}` to `${{ steps.bump_version.outputs.new_version }}`.
### Changes
- Updated version in `setup.py`
- Updated version in `docs/conf.py`
- Updated version in `src/datapilot/__init__.py`
- Updated version in `.bumpversion.cfg`
### Type of change
- Version bump (${{ github.event.inputs.version_part }})
---
*This PR was automatically created by the bump version workflow.*
branch: bump-version-${{ steps.bump_version.outputs.new_version }}
delete-branch: true
labels: |
version-bump
automated