Skip to content

Commit 8a1f1b4

Browse files
committed
ci: add GitHub Actions, release workflow, and repo hygiene docs
Add CI (ruff lint/format, mypy, pytest, build+twine check) and a tag-based release workflow. Include optional pre-commit hooks and standard repo docs (LICENSE/CHANGELOG/CONTRIBUTING/versioning). Update packaging metadata (project URLs) and document quality checks in README.
1 parent b94efdb commit 8a1f1b4

10 files changed

Lines changed: 229 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
ci:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: ["3.12"]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
cache: pip
27+
28+
- name: Install (editable + dev extras)
29+
run: |
30+
python -m pip install --upgrade pip
31+
python -m pip install -e ".[dev]"
32+
33+
- name: Ruff (lint)
34+
run: |
35+
python -m ruff check .
36+
37+
- name: Ruff (format check)
38+
run: |
39+
python -m ruff format --check .
40+
41+
- name: Mypy
42+
run: |
43+
python -m mypy src/rune_companion
44+
45+
- name: Pytest
46+
run: |
47+
python -m pytest
48+
49+
- name: Build dist (sdist/wheel)
50+
run: |
51+
python -m pip install --upgrade build twine
52+
python -m build
53+
python -m twine check dist/*

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
cache: pip
24+
25+
- name: Install (editable + dev extras)
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install -e ".[dev]"
29+
python -m pip install --upgrade build twine
30+
31+
- name: Validate (lint/type/tests)
32+
run: |
33+
python -m ruff check .
34+
python -m ruff format --check .
35+
python -m mypy src/rune_companion
36+
python -m pytest
37+
38+
- name: Build dist
39+
run: |
40+
python -m build
41+
python -m twine check dist/*
42+
43+
- name: Create GitHub Release (attach dist/*)
44+
uses: softprops/action-gh-release@v2
45+
with:
46+
generate_release_notes: true
47+
files: dist/*

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- id: check-toml
8+
- id: check-yaml
9+
10+
- repo: https://github.com/astral-sh/ruff-pre-commit
11+
rev: v0.15.1
12+
hooks:
13+
- id: ruff
14+
args: [--fix]
15+
- id: ruff-format

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
6+
7+
## [Unreleased]
8+
### Added
9+
- GitHub Actions CI (ruff, mypy, pytest, build).
10+
- Release workflow that attaches dist artifacts to GitHub Releases.
11+
- Offline console demo mode (no external services required).
12+
- Initial MVP: console connector, memory store, task scheduler, OpenRouter LLM client.

CONTRIBUTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Contributing
2+
3+
Thanks for your interest in contributing!
4+
5+
## Development setup
6+
```bash
7+
python -m venv .venv
8+
source .venv/bin/activate
9+
pip install -e ".[dev]"
10+
```
11+
12+
## Running checks
13+
```bash
14+
python -m ruff check .
15+
python -m ruff format --check .
16+
python -m mypy src/rune_companion
17+
python -m pytest
18+
```
19+
20+
## Code style
21+
- Production code, docs, and comments must be in English.
22+
- Keep modules small and responsibilities clear.
23+
- Prefer typed public APIs and deterministic behavior.
24+
25+
## Pull requests
26+
- Keep PRs focused and reviewable.
27+
- Include tests for behavioral changes.
28+
- Update CHANGELOG.md for user-facing changes.
29+
30+
## Versioning / Releases
31+
- This project follows SemVer.
32+
- Tag releases as vMAJOR.MINOR.PATCH (e.g. v0.2.0).

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 ogyrec
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Rune Companion
22

3+
![CI](https://github.com/ogyrec-o/rune-companion/actions/workflows/ci.yml/badge.svg)
4+
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
5+
![Python](https://img.shields.io/badge/python-3.12-blue.svg)
6+
37
Rune Companion is a small, publishable chat companion framework with:
48

59
- streaming LLM replies (OpenAI/OpenRouter-compatible),
@@ -44,6 +48,9 @@ pip install -U pip
4448
# Install the package in editable mode
4549
pip install -e .
4650

51+
# Dev tools (ruff/mypy/pytest)
52+
pip install -e ".[dev]"
53+
4754
# Matrix connector is optional
4855
pip install -e ".[matrix]"
4956
```
@@ -67,6 +74,15 @@ RUNE_SAVE_HISTORY=true
6774
RUNE_TTS_MODE=false
6875
```
6976

77+
### Offline demo (no external services)
78+
If you don't set `RUNE_OPENROUTER_API_KEY` (or disable LLM explicitly), the app runs in a deterministic
79+
offline demo mode. This keeps the console connector usable without external services.
80+
81+
Enable offline mode explicitly:
82+
```text
83+
RUNE_LLM_ENABLED=false
84+
```
85+
7086
### 3) Run
7187
The package installs a CLI entrypoint:
7288
```bash
@@ -113,4 +129,13 @@ These files are expected to be gitignored.
113129
- Python: 3.12+
114130
- Formatting/linting: ruff (see pyproject.toml)
115131

132+
## Quality checks (same as CI)
133+
134+
```bash
135+
python -m ruff check .
136+
python -m ruff format --check .
137+
python -m mypy src/rune_companion
138+
python -m pytest
139+
```
140+
116141
License: MIT.

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,16 @@ dev = [
3030
"mypy>=1.8.0",
3131
"pytest>=8.0.0",
3232
"pytest-asyncio>=0.23.0",
33+
"pre-commit>=3.7.0",
34+
"build>=1.2.0",
35+
"twine>=5.0.0",
3336
]
3437

38+
[project.urls]
39+
Homepage = "https://github.com/ogyrec-o/rune-companion"
40+
Repository = "https://github.com/ogyrec-o/rune-companion"
41+
Issues = "https://github.com/ogyrec-o/rune-companion/issues"
42+
3543
[tool.ruff]
3644
target-version = "py312"
3745
line-length = 100

src/rune_companion/llm/offline.py

Whitespace-only changes.

versioning.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Versioning policy
2+
3+
This project uses Semantic Versioning (SemVer): `MAJOR.MINOR.PATCH`.
4+
5+
- **PATCH**: bug fixes, internal refactors, no API breakage.
6+
- **MINOR**: new features, backwards compatible changes.
7+
- **MAJOR**: breaking changes in public APIs or behavior.
8+
9+
## Release process
10+
11+
1. Update `CHANGELOG.md` (move items from Unreleased to a new version section).
12+
2. Bump `version` in `pyproject.toml`.
13+
3. Create a Git tag: `vMAJOR.MINOR.PATCH`.
14+
4. Push the tag to GitHub.
15+
16+
GitHub Actions will build and attach `dist/*` artifacts to the release.

0 commit comments

Comments
 (0)