diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f9b8db..8808252 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,10 +6,9 @@ on: - "v*" jobs: - publish: + release: runs-on: ubuntu-latest permissions: - id-token: write contents: write steps: - name: Checkout @@ -25,9 +24,6 @@ jobs: python -m pip install --upgrade pip build python -m build - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: diff --git a/.gitignore b/.gitignore index 22889f5..8421ffc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ __pycache__/ +.venv/ *.pyc .gitcoach-mailmap .pytest_cache/ diff --git a/README.md b/README.md index 0fb1674..051cd77 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Small, opinionated Git helper for solo developers. - Keeping `dev` and `main` separated without extra ceremony - Avoiding accidental commits of untracked files - Switching between safety profiles (`solo-safe`, `fast`, `strict`) without editing hooks manually -- Safe undo/rollback actions without scary git commands +- Safe undo/rollback actions without memorizing low-level Git commands - Shipping safely with fast-forward merges - Diagnosing and fixing GitHub contributions issues caused by wrong commit email @@ -82,18 +82,24 @@ python3 gitcoach.py interactive ## Installation -From PyPI: +Install directly from GitHub: ```bash -pipx install gitcoach +python3 -m venv .venv +. .venv/bin/activate +python3 -m pip install git+https://github.com/jodonnell24/gitcoach.git ``` -From local checkout: +Or install from a local checkout: ```bash -pipx install . +python3 -m venv .venv +. .venv/bin/activate +python3 -m pip install -e . ``` +The `gitcoach` name on PyPI currently belongs to an unrelated older project, so avoid `pip install gitcoach` for this repo until a package name is published for this implementation. + ## Commit Message Help Draft suggestions: @@ -117,10 +123,12 @@ python3 gitcoach.py save --guided --strict-message ## 60-Second Quickstart -Install with pipx: +Install from GitHub: ```bash -pipx install gitcoach +python3 -m venv .venv +. .venv/bin/activate +python3 -m pip install git+https://github.com/jodonnell24/gitcoach.git ``` Try a safe beginner flow: @@ -172,7 +180,7 @@ If you already have custom hooks and want to overwrite them: python3 gitcoach.py guard --force ``` -Noob-friendly behavior when guards are enabled: +Beginner-friendly behavior when guards are enabled: - If `save` is blocked on `main`, `gitcoach` offers to auto-create a feature branch and retries commit there. - `start` works even with dirty changes; it carries your work into the feature branch automatically. @@ -293,6 +301,21 @@ Includes: - Revert a chosen commit - Restore one file back to `HEAD` +## Development + +Install the package with development tools, then run the test suite: + +```bash +python3 -m pip install -e ".[dev]" build +python3 -m pytest +``` + +Build package artifacts locally with: + +```bash +python3 -m build +``` + ## Safety Notes - Rewriting history changes commit hashes. diff --git a/RELEASING.md b/RELEASING.md index c96ee2f..701f12d 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,8 +1,10 @@ # Releasing GitCoach +GitCoach is not currently published to PyPI. The `gitcoach` name on PyPI belongs to an unrelated older project, so tagged releases currently build artifacts and attach them to a GitHub Release only. + ## 1. Prepare release -1. Ensure tests pass locally: `pytest` +1. Ensure tests pass locally: `python -m pytest` 2. Update version in `pyproject.toml` 3. Update `CHANGELOG.md` 4. Commit changes @@ -19,15 +21,18 @@ git push origin v0.1.0 On `v*` tags, GitHub Actions will: - Build `sdist` and `wheel` -- Publish to PyPI (`pypa/gh-action-pypi-publish`) -- Create a GitHub release with generated notes +- Create a GitHub Release with generated notes +- Attach the built `sdist` and `wheel` artifacts ## 4. Verify -1. Confirm package on PyPI -2. Test install in clean env: +Test the GitHub install path in a clean environment: ```bash -pipx install gitcoach +python -m venv /tmp/gitcoach-release-check +. /tmp/gitcoach-release-check/bin/activate +python -m pip install git+https://github.com/jodonnell24/gitcoach.git gitcoach --help ``` + +If a PyPI release becomes a goal later, choose and reserve a package name before adding PyPI publishing back to the release workflow.