Skip to content

Commit

Permalink
Replace bumpversion with bump-my-version & re-introduce github action
Browse files Browse the repository at this point in the history
  • Loading branch information
p3zo committed Jun 17, 2024
1 parent c68a89f commit 69f0e33
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: bump_version

on:
push:
branches: [main]

jobs:
bump-version:
if: "!contains(github.event.head_commit.message, 'Bump version')"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Bump minor version
run: |
set -x
git config --global user.name "p3zo"
git config --global user.email "[email protected]"
git config --global pull.rebase false
BRANCH=${GITHUB_REF#refs/heads/}
pip install --no-cache-dir bump-my-version
git remote add p3zo https://${{ secrets.BOT_TOKEN }}@github.com/$GITHUB_REPOSITORY
git pull --no-edit p3zo $BRANCH
bump-my-version bump minor chord_progressions/__init__.py
git push --tags p3zo HEAD:$BRANCH
19 changes: 18 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,26 @@ exclude = ["scripts", "docs", "site", "assets", "tests", "dist"]
version = {attr = "chord_progressions.__version__"}

[project.optional-dependencies]
dev = ["pytest", "pytest-cov", "black", "flake8", "ipdb", "ipython", "isort", "bumpversion", "mkdocs-material"]
dev = ["pytest", "pytest-cov", "black", "flake8", "ipdb", "ipython", "isort", "bump-my-version", "mkdocs-material"]
test = ["pytest", "pytest-cov"]

[project.urls]
Homepage = "https://github.com/p3zo/chord-progressions"
Issues = "https://github.com/p3zo/chord-progressions/issues"

[tool.bumpversion]
current_version = "0.33.0"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
tag = true
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = true
message = "Bump version: {current_version} → {new_version}"
commit_args = ""
5 changes: 0 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
[bumpversion]
current_version = 0.33.0

[bumpversion:file:chord_progressions/__init__.py]

[flake8]
max-line-length = 100
max-complexity = 18
Expand Down

0 comments on commit 69f0e33

Please sign in to comment.