diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 12d5017..cc66f45 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,4 +42,12 @@ repos: args: - --fix - id: ruff-format + - repo: local + hooks: + - id: bump-my-version + name: bumpy + entry: bump-version.sh + language: script + pass_filenames: false + exclude: (.pre-commit-config.yaml) exclude: "^(references|reports)" diff --git a/bump-version.sh b/bump-version.sh new file mode 100755 index 0000000..31c8d02 --- /dev/null +++ b/bump-version.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# adapted from: https://github.com/pre-commit/pre-commit/issues/1825 +set -e +if git diff --exit-code origin/main -- version; then + bump-my-version bump --allow-dirty patch version --current-version `cat version` +fi diff --git a/pixi.toml b/pixi.toml index 2a61f6c..dd58e06 100644 --- a/pixi.toml +++ b/pixi.toml @@ -32,3 +32,5 @@ pytest = "*" pytest-cov = "*" # linting pre-commit = "*" +# versioning +bump-my-version = "*" diff --git a/version b/version index d169b2f..c5d54ec 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.0.8 +0.0.9