mirror of
https://github.com/shadoll/moma.git
synced 2026-08-28 03:27:34 +00:00
feat: Add justfile for version bumping and release process automation
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
# Bump patch version in pyproject.toml and INSTALL.md
|
||||||
|
bump:
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import re
|
||||||
|
with open('pyproject.toml', 'r') as f:
|
||||||
|
content = f.read()
|
||||||
|
m = re.search(r'version = "(\d+)\.(\d+)\.(\d+)"', content)
|
||||||
|
if m:
|
||||||
|
old = m.group(1) + '.' + m.group(2) + '.' + m.group(3)
|
||||||
|
major, minor, patch = map(int, m.groups())
|
||||||
|
new = f'{major}.{minor}.{patch + 1}'
|
||||||
|
with open('pyproject.toml', 'w') as f:
|
||||||
|
f.write(content.replace(m.group(0), f'version = "{new}"'))
|
||||||
|
with open('INSTALL.md', 'r') as f:
|
||||||
|
install = f.read()
|
||||||
|
with open('INSTALL.md', 'w') as f:
|
||||||
|
f.write(install.replace(old, new))
|
||||||
|
print(f'Version bumped to {new}')
|
||||||
|
else:
|
||||||
|
print('Version not found')
|
||||||
|
|
||||||
|
# Bump version, sync dependencies, and build package
|
||||||
|
release: bump
|
||||||
|
uv sync
|
||||||
|
uv build
|
||||||
|
@echo "Release process completed successfully!"
|
||||||
|
|
||||||
|
# Run tests
|
||||||
|
test:
|
||||||
|
uv run pytest
|
||||||
|
|
||||||
|
# Run the application
|
||||||
|
run *ARGS:
|
||||||
|
uv run moma {{ARGS}}
|
||||||
@@ -23,8 +23,6 @@ dev = [
|
|||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
moma = "main:main"
|
moma = "main:main"
|
||||||
bump-version = "bump:main"
|
|
||||||
release = "release:main"
|
|
||||||
|
|
||||||
[tool.uv]
|
[tool.uv]
|
||||||
package = true
|
package = true
|
||||||
|
|||||||
Reference in New Issue
Block a user