Skip to content

Commit bd45607

Browse files
committed
ci: Add BumpVer for automated version management
1 parent 32b50c4 commit bd45607

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Automatically create GitHub Release when a version tag is pushed
2+
# This triggers the publish.yml workflow to upload to PyPI
3+
name: Create Release
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Create GitHub Release
20+
uses: softprops/action-gh-release@v1
21+
with:
22+
generate_release_notes: true
23+
draft: false
24+
prerelease: false
25+

pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ dev = [
5353
"mypy>=1.0.0",
5454
"build>=1.0.0",
5555
"twine>=4.0.0",
56+
"bumpver>=2023.1129",
5657
]
5758
all = [
5859
"dii-calculator[dev]",
@@ -88,3 +89,17 @@ testpaths = ["tests"]
8889
python_files = ["test_*.py"]
8990
addopts = "-v --tb=short"
9091

92+
[tool.bumpver]
93+
current_version = "1.0.7"
94+
version_pattern = "MAJOR.MINOR.PATCH"
95+
commit_message = "release: v{new_version}"
96+
commit = true
97+
tag = true
98+
push = true
99+
100+
[tool.bumpver.file_patterns]
101+
"pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"']
102+
"src/dii/__init__.py" = ['__version__ = "{version}"']
103+
"README.md" = ['dii-calculator=={version}', 'version {version}']
104+
"CITATION.cff" = ['version: {version}']
105+

0 commit comments

Comments
 (0)