-
Notifications
You must be signed in to change notification settings - Fork 286
Expand file tree
/
Copy pathMakefile
More file actions
105 lines (87 loc) · 3.69 KB
/
Makefile
File metadata and controls
105 lines (87 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
.PHONY: install dev test lint format clean help run run-remote remote-attach remote-stop \
bump-patch bump-minor bump-major release version
# Default target
help:
@echo "Available commands:"
@echo " install - Install production dependencies"
@echo " dev - Install development dependencies"
@echo " test - Run tests"
@echo " lint - Run linting checks"
@echo " format - Format code"
@echo " clean - Clean up generated files"
@echo " run - Run the bot"
@echo " version - Show current version"
@echo " bump-patch - Bump patch version (1.2.0 -> 1.2.1), commit, and tag"
@echo " bump-minor - Bump minor version (1.2.0 -> 1.3.0), commit, and tag"
@echo " bump-major - Bump major version (1.2.0 -> 2.0.0), commit, and tag"
@echo " release - Push current version tag to trigger release workflow"
@echo " run-remote - Start bot in tmux on remote Mac (unlocks keychain)"
@echo " remote-attach - Attach to running bot tmux session"
@echo " remote-stop - Stop the bot tmux session"
install:
poetry install --no-dev
dev:
poetry install
poetry run pre-commit install --install-hooks || echo "pre-commit not configured yet"
test:
poetry run pytest
lint:
poetry run black --check src tests
poetry run isort --check-only src tests
poetry run flake8 src tests
poetry run mypy src
format:
poetry run black src tests
poetry run isort src tests
clean:
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
rm -rf .coverage htmlcov/ .pytest_cache/ dist/ build/
run:
poetry run claude-telegram-bot
# For debugging
run-debug:
poetry run claude-telegram-bot --debug
# Remote Mac Mini (SSH session)
run-remote: ## Start bot on remote Mac in tmux (persists after SSH disconnect)
security unlock-keychain ~/Library/Keychains/login.keychain-db
tmux new-session -d -s claude-bot 'poetry run claude-telegram-bot'
@echo "Bot started in tmux session 'claude-bot'"
@echo " Attach: make remote-attach"
@echo " Stop: make remote-stop"
remote-attach: ## Attach to running bot tmux session
tmux attach -t claude-bot
remote-stop: ## Stop the bot tmux session
tmux kill-session -t claude-bot
# --- Version Management ---
version: ## Show current version
@poetry version -s
bump-patch: ## Bump patch version, commit, and tag
poetry version patch && \
NEW_VERSION=$$(poetry version -s) && \
git add pyproject.toml && \
git commit -m "release: v$$NEW_VERSION" && \
git tag "v$$NEW_VERSION" && \
git push && git push origin "v$$NEW_VERSION" && \
echo "Released v$$NEW_VERSION. Tag pushed — release workflow will run on GitHub."
bump-minor: ## Bump minor version, commit, and tag
poetry version minor && \
NEW_VERSION=$$(poetry version -s) && \
git add pyproject.toml && \
git commit -m "release: v$$NEW_VERSION" && \
git tag "v$$NEW_VERSION" && \
git push && git push origin "v$$NEW_VERSION" && \
echo "Released v$$NEW_VERSION. Tag pushed — release workflow will run on GitHub."
bump-major: ## Bump major version, commit, and tag
poetry version major && \
NEW_VERSION=$$(poetry version -s) && \
git add pyproject.toml && \
git commit -m "release: v$$NEW_VERSION" && \
git tag "v$$NEW_VERSION" && \
git push && git push origin "v$$NEW_VERSION" && \
echo "Released v$$NEW_VERSION. Tag pushed — release workflow will run on GitHub."
release: ## Push the current version tag to trigger the release workflow
CURRENT_VERSION=$$(poetry version -s) && \
git push && git push origin "v$$CURRENT_VERSION" && \
echo "Pushed v$$CURRENT_VERSION. Release workflow will run on GitHub."