diff --git a/.claude/bootstrap-version b/.claude/bootstrap-version new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/.claude/bootstrap-version @@ -0,0 +1 @@ +2 diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..49da0e9 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,25 @@ +{ + "hooks": { + "PostToolUse": [ + { + "matcher": "Edit|Write", + "hooks": [ + { + "type": "command", + "command": "uv run --quiet ruff format --quiet src tests 2>/dev/null || true" + } + ] + } + ], + "Stop": [ + { + "hooks": [ + { + "type": "command", + "command": "uv run --quiet ruff check --quiet . && uv run --quiet pytest -q -x 2>&1 | tail -3" + } + ] + } + ] + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1c86571 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI + +on: + pull_request: + branches: [development] + push: + branches: [development, main] + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + - run: uv sync --locked + - name: Lint + run: uv run ruff check . && uv run ruff format --check . + - name: Test + run: uv run pytest -q diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml new file mode 100644 index 0000000..0d07108 --- /dev/null +++ b/.github/workflows/version.yml @@ -0,0 +1,65 @@ +name: Version bump + +on: + push: + branches: [development, main] + +permissions: + contents: write + +jobs: + bump: + if: github.actor != 'github-actions[bot]' && !contains(github.event.head_commit.message, '[skip ci]') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Bump version + id: bump + run: | + set -e + CURRENT=$(cat VERSION) + MAJOR=$(echo "$CURRENT" | cut -d. -f1) + MINOR=$(echo "$CURRENT" | cut -d. -f2) + PATCH=$(echo "$CURRENT" | cut -d. -f3) + + if [ "${{ github.ref_name }}" = "development" ]; then + PATCH=$((PATCH + 1)) + elif [ "${{ github.ref_name }}" = "main" ]; then + # Did this push bring in commits that all come from development + # (i.e. an approved development -> main PR merge)? + PARENTS=$(git log -1 --pretty=%P HEAD) + PARENT_COUNT=$(echo "$PARENTS" | wc -w) + if [ "$PARENT_COUNT" -gt 1 ] && [ "${{ github.event.head_commit.message }}" != "" ] && git log -1 --pretty=%B | grep -qi "development"; then + MINOR=$((MINOR + 1)) + PATCH=0 + else + PATCH=$((PATCH + 1)) + fi + fi + + NEW_VERSION="$MAJOR.$MINOR.$PATCH" + echo "$NEW_VERSION" > VERSION + echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT" + + - name: Commit version bump + run: | + git add VERSION + git commit -m "chore(release): v${{ steps.bump.outputs.new_version }} [skip ci]" + git push origin HEAD:${{ github.ref_name }} + + - name: Merge main back into development + if: github.ref_name == 'main' + run: | + git fetch origin development + git checkout development + git merge --no-edit main + git push origin development diff --git a/.gitignore b/.gitignore index 7b32a3b..6478ae1 100644 --- a/.gitignore +++ b/.gitignore @@ -18,10 +18,11 @@ vn/*/traceback.txt vn/*/errors.txt vn/*/lint.txt # Local Ren'Py SDK and builds -tools/ +/tools build/ -# Local agent/sandbox state -.claude/ +# Local agent state (shared settings in .claude/settings.json are committed) +.claude/settings.local.json +.claude/worktrees/ .mcp.json # Original generated images are large; final processed assets are committed instead works/*/assets/raw/ diff --git a/CLAUDE.md b/CLAUDE.md index 00ecba9..24f3264 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -14,8 +14,16 @@ Pipeline (`vnpipe`) that turns a public-domain play into a Ren'Py visual novel; - `uv sync` — install. `uv run pytest` — tests. `uv run ruff check . && uv run ruff format --check .` — lint. - `uv run vnpipe --help` — pipeline CLI. Stages: `fetch`, `parse`, `annotate {chunk,status,prompt,merge}`, `assets {prompt,import,process,status,placeholders,sheet}`, `renpy [--with-test]`. -- Ren'Py SDK lives in `tools/renpy-sdk` (gitignored); prefix SDK commands with `HOME=$TMPDIR/renpy-home`. +- Ren'Py SDK lives in `tools/renpy-sdk` (gitignored; may be a symlink shared between worktrees). + Inside the sandbox prefix SDK commands with `HOME=$TMPDIR/renpy-home`. Lint: `tools/renpy-sdk/renpy.sh vn/faust lint`. Playthrough test and builds: `docs/running.md`. +## Branches and versions +- `development` is the integration branch; `main` receives reviewed merges from it. + Feature work branches off `development` (`feat/...`, `fix/...`). +- `VERSION` is bumped by `.github/workflows/version.yml` on push (patch on `development`, + minor on a `development` → `main` merge). Do not edit it by hand. +- CI (`.github/workflows/ci.yml`) runs ruff and pytest. + ## Layout See `docs/plan.md`. diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..6e8bf73 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.1.0