4 Commits

Author SHA1 Message Date
47dcab8fea chore: make Gitea the primary remote, GitHub as mirror (#2)
Some checks failed
CI / Build and Test (push) Has been cancelled
2026-02-20 18:25:39 +00:00
Ryan Hamamura
e63ebd1401 ci: re-trigger workflow
Some checks failed
CI / Build and Test (push) Has been cancelled
2026-02-19 14:49:48 -10:00
Ryan Hamamura
b26ded951f ci: trigger initial workflow run
Some checks failed
CI / Build and Test (push) Has been cancelled
2026-02-19 14:45:19 -10:00
Ryan Hamamura
8bb1b99ae9 chore: add PR workflow and worktree-aware release process
Some checks failed
CI / Build and Test (push) Has been cancelled
2026-02-19 14:43:46 -10:00
4 changed files with 46 additions and 14 deletions

14
.claude/commands/pr.md Normal file
View File

@@ -0,0 +1,14 @@
Create a PR on Gitea, wait for CI, and squash-merge it. Push code to both remotes.
1. If in a worktree (working directory contains `.claude/worktrees/`), you are already on a feature branch — do NOT create a new one. Otherwise, create a new branch from main with a descriptive name.
2. Stage and commit all changes with a clean, semantic commit message. No Claude attribution lines.
3. Fetch latest main and rebase: `git fetch gitea main && git rebase gitea/main`.
- If conflicts occur, abort the rebase (`git rebase --abort`), analyze the conflicting files, write a plan to resolve them, and present the plan to the user before proceeding.
4. Push the branch to both remotes: `git push -u gitea <branch> && git push origin <branch>` (use `--force-with-lease` if already pushed).
5. Create a Gitea PR: `tea pr create --head <branch> --base main`. Reference related issues with `#X`. Only use `Closes #X` if the PR fully resolves the issue.
6. Wait for CI to pass: poll Gitea CI status. If CI fails, report the failure and stop — do not merge.
7. Once CI passes, squash-merge on Gitea: `tea pr merge <index> --style squash` with a clean, semantic commit message including the PR number. No Claude attribution lines.
8. Update local main and push to both remotes: `git checkout main && git pull gitea main && git push origin main`.
9. Clean up remote branches: `git push gitea --delete <branch> && git push origin --delete <branch>`.
10. Prune refs: `git remote prune gitea && git remote prune origin`.
11. Report the merged PR URL.

View File

@@ -1,14 +1,20 @@
Create a new release for this project. Steps:
Create a new release on Gitea. Push tags to both remotes.
1. Fetch tags from all remotes so the version list is current.
2. Check for uncommitted changes. If any exist, commit them with a clean semantic commit message. No Claude attribution lines.
3. Review the commits since the last tag. Based on their content, recommend a semver bump:
## Pre-flight
1. **Worktree guard**: If the working directory is inside `.claude/worktrees/`, STOP and tell the user: "Releases must be created from a non-worktree session on main. Exit this worktree or start a new session, then run /release." Do not proceed.
2. Verify you are on `main`. If not, STOP.
3. Verify there are no uncommitted changes. If there are, STOP — they should go through a PR.
4. Run `git pull --ff-only` on main. Fetch tags from all remotes.
## Release
5. Review commits since the last tag. Recommend a semver bump:
- **major**: breaking/incompatible API changes
- **minor**: new features, meaningful new behavior
- **patch**: bug fixes, docs, refactoring with no new features
Present the proposed version, the bump rationale, and the commit list. Wait for user approval before continuing.
4. Tag the new version and push the tag + commits to all remotes (origin, gitea, etc.).
5. Generate release notes from the commits since the last tag, grouped by type (features, fixes, docs/refactoring).
6. Create a GitHub release using `gh release create`.
7. Create a Gitea release using `tea releases create` with the same notes.
8. Report both release URLs and confirm all remotes are up to date.
Present the proposed version, bump rationale, and commit list. Wait for user approval.
6. Tag the new version. Push the tag to both remotes: `git push gitea <tag> && git push origin <tag>`.
7. Generate release notes grouped by type (features, fixes, chores).
8. Create a Gitea release with `tea releases create` using the notes.
9. Report the release URL and confirm all remotes are up to date.

View File

@@ -8,9 +8,6 @@ on:
branches:
- '**'
permissions:
contents: read
jobs:
build-test:
name: Build and Test

View File

@@ -1,5 +1,20 @@
# Via Project Instructions
## Workflow
All changes go through PRs:
1. Enter a worktree (`EnterWorktree`) at session start.
2. Make changes, commit with semantic messages.
3. `/pr` to push, open a PR, wait for CI, and squash-merge.
## Releasing
Run `/release` from a **non-worktree session on main**. It tags and publishes
what is already on main — it does not commit new changes.
## Worktree Usage
Always enter a worktree at the start of a session using the `EnterWorktree` tool. This prevents parallel Claude Code sessions from interfering with each other.
Always enter a worktree at the start of a session using the `EnterWorktree`
tool. This prevents parallel Claude Code sessions from interfering with each
other.