gearu 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gearu-0.1.1/.github/workflows/docs.yml +63 -0
- gearu-0.1.1/.github/workflows/publish.yml +122 -0
- gearu-0.1.1/.gitignore +11 -0
- gearu-0.1.1/AGENTS.md +24 -0
- gearu-0.1.1/LICENSE +22 -0
- gearu-0.1.1/PKG-INFO +163 -0
- gearu-0.1.1/README.md +142 -0
- gearu-0.1.1/RELEASE.md +122 -0
- gearu-0.1.1/dev-docs/GearuDesign.md +77 -0
- gearu-0.1.1/docs/CLI.md +82 -0
- gearu-0.1.1/docs/Configuration.md +162 -0
- gearu-0.1.1/docs/README.md +43 -0
- gearu-0.1.1/docs/ReleaseProcess.md +120 -0
- gearu-0.1.1/docs-requirements.txt +2 -0
- gearu-0.1.1/gearu.toml +23 -0
- gearu-0.1.1/mkdocs.yml +58 -0
- gearu-0.1.1/pyproject.toml +54 -0
- gearu-0.1.1/run_tests.py +21 -0
- gearu-0.1.1/scripts/generate_cli_reference.py +100 -0
- gearu-0.1.1/setup.cfg +4 -0
- gearu-0.1.1/src/gearu/__init__.py +5 -0
- gearu-0.1.1/src/gearu/__main__.py +5 -0
- gearu-0.1.1/src/gearu/_version.py +25 -0
- gearu-0.1.1/src/gearu/adapters/__init__.py +22 -0
- gearu-0.1.1/src/gearu/adapters/base.py +35 -0
- gearu-0.1.1/src/gearu/adapters/npm.py +68 -0
- gearu-0.1.1/src/gearu/adapters/python.py +84 -0
- gearu-0.1.1/src/gearu/adapters/rust.py +84 -0
- gearu-0.1.1/src/gearu/bootstrap.py +231 -0
- gearu-0.1.1/src/gearu/cli.py +228 -0
- gearu-0.1.1/src/gearu/config.py +366 -0
- gearu-0.1.1/src/gearu/dependency_checks.py +64 -0
- gearu-0.1.1/src/gearu/errors.py +5 -0
- gearu-0.1.1/src/gearu/git.py +202 -0
- gearu-0.1.1/src/gearu/github.py +46 -0
- gearu-0.1.1/src/gearu/manifests.py +170 -0
- gearu-0.1.1/src/gearu/models.py +141 -0
- gearu-0.1.1/src/gearu/process.py +55 -0
- gearu-0.1.1/src/gearu/release.py +499 -0
- gearu-0.1.1/src/gearu/version.py +94 -0
- gearu-0.1.1/src/gearu.egg-info/PKG-INFO +163 -0
- gearu-0.1.1/src/gearu.egg-info/SOURCES.txt +55 -0
- gearu-0.1.1/src/gearu.egg-info/dependency_links.txt +1 -0
- gearu-0.1.1/src/gearu.egg-info/entry_points.txt +2 -0
- gearu-0.1.1/src/gearu.egg-info/scm_file_list.json +52 -0
- gearu-0.1.1/src/gearu.egg-info/scm_version.json +8 -0
- gearu-0.1.1/src/gearu.egg-info/top_level.txt +1 -0
- gearu-0.1.1/src/tests/test_adapters.py +56 -0
- gearu-0.1.1/src/tests/test_bootstrap.py +79 -0
- gearu-0.1.1/src/tests/test_cli.py +95 -0
- gearu-0.1.1/src/tests/test_cli_reference.py +35 -0
- gearu-0.1.1/src/tests/test_config.py +163 -0
- gearu-0.1.1/src/tests/test_dependency_checks.py +81 -0
- gearu-0.1.1/src/tests/test_manifests.py +68 -0
- gearu-0.1.1/src/tests/test_release.py +380 -0
- gearu-0.1.1/src/tests/test_version.py +98 -0
- gearu-0.1.1/uv.lock +728 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
ref:
|
|
9
|
+
description: "Git ref containing the documentation site files"
|
|
10
|
+
required: true
|
|
11
|
+
default: main
|
|
12
|
+
type: string
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
pages: write
|
|
17
|
+
id-token: write
|
|
18
|
+
|
|
19
|
+
concurrency:
|
|
20
|
+
group: pages
|
|
21
|
+
cancel-in-progress: false
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
build:
|
|
25
|
+
# Keep stable documentation on the stable release when an RC is published.
|
|
26
|
+
if: github.event_name == 'workflow_dispatch' || !github.event.release.prerelease
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
steps:
|
|
29
|
+
- name: Check out the documentation source
|
|
30
|
+
uses: actions/checkout@v6
|
|
31
|
+
with:
|
|
32
|
+
ref: ${{ github.event.release.tag_name || inputs.ref }}
|
|
33
|
+
fetch-depth: 0
|
|
34
|
+
persist-credentials: false
|
|
35
|
+
- name: Set up Python
|
|
36
|
+
uses: actions/setup-python@v7
|
|
37
|
+
with:
|
|
38
|
+
python-version: "3.12"
|
|
39
|
+
cache: pip
|
|
40
|
+
cache-dependency-path: docs-requirements.txt
|
|
41
|
+
- name: Install documentation dependencies
|
|
42
|
+
run: pip install -r docs-requirements.txt
|
|
43
|
+
- name: Check generated CLI reference
|
|
44
|
+
run: python scripts/generate_cli_reference.py --check
|
|
45
|
+
- name: Build documentation
|
|
46
|
+
run: mkdocs build --strict
|
|
47
|
+
- name: Configure GitHub Pages
|
|
48
|
+
uses: actions/configure-pages@v6
|
|
49
|
+
- name: Upload GitHub Pages artifact
|
|
50
|
+
uses: actions/upload-pages-artifact@v5
|
|
51
|
+
with:
|
|
52
|
+
path: site
|
|
53
|
+
|
|
54
|
+
deploy:
|
|
55
|
+
needs: build
|
|
56
|
+
runs-on: ubuntu-latest
|
|
57
|
+
environment:
|
|
58
|
+
name: github-pages
|
|
59
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
60
|
+
steps:
|
|
61
|
+
- name: Deploy to GitHub Pages
|
|
62
|
+
id: deployment
|
|
63
|
+
uses: actions/deploy-pages@v5
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Publish Gearu only after a GitHub Release is published. PyPI Trusted
|
|
2
|
+
# Publishing provides short-lived OIDC authentication and package attestations;
|
|
3
|
+
# this repository stores no PyPI API token.
|
|
4
|
+
|
|
5
|
+
name: Publish gearu
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
release:
|
|
9
|
+
types: [published]
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
test:
|
|
16
|
+
name: Tests (Python ${{ matrix.python }})
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
strategy:
|
|
19
|
+
fail-fast: false
|
|
20
|
+
matrix:
|
|
21
|
+
python: ["3.11", "3.12", "3.13", "3.14"]
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v6
|
|
25
|
+
with:
|
|
26
|
+
fetch-depth: 0
|
|
27
|
+
ref: ${{ github.event.release.tag_name }}
|
|
28
|
+
|
|
29
|
+
- uses: actions/setup-python@v7
|
|
30
|
+
with:
|
|
31
|
+
python-version: ${{ matrix.python }}
|
|
32
|
+
|
|
33
|
+
- name: Run tests
|
|
34
|
+
run: |
|
|
35
|
+
python -m pip install --upgrade pytest setuptools-scm
|
|
36
|
+
PYTHONPATH=src python -m pytest src/tests -q
|
|
37
|
+
|
|
38
|
+
build:
|
|
39
|
+
name: Build sdist and wheel
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
needs: test
|
|
42
|
+
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v6
|
|
45
|
+
with:
|
|
46
|
+
fetch-depth: 0
|
|
47
|
+
ref: ${{ github.event.release.tag_name }}
|
|
48
|
+
|
|
49
|
+
- uses: actions/setup-python@v7
|
|
50
|
+
with:
|
|
51
|
+
python-version: "3.13"
|
|
52
|
+
|
|
53
|
+
- name: Validate release identity
|
|
54
|
+
env:
|
|
55
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
56
|
+
run: |
|
|
57
|
+
python -m pip install --upgrade setuptools-scm
|
|
58
|
+
python - <<'PY'
|
|
59
|
+
import os
|
|
60
|
+
import re
|
|
61
|
+
|
|
62
|
+
from setuptools_scm import get_version
|
|
63
|
+
|
|
64
|
+
tag = os.environ["RELEASE_TAG"]
|
|
65
|
+
if re.fullmatch(r"v[0-9]+\.[0-9]+\.[0-9]+(?:-rc\.[1-9][0-9]*)?", tag) is None:
|
|
66
|
+
raise SystemExit(
|
|
67
|
+
"release tag must be vMAJOR.MINOR.PATCH or "
|
|
68
|
+
f"vMAJOR.MINOR.PATCH-rc.N, got {tag!r}"
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
version = get_version()
|
|
72
|
+
expected = re.sub(r"-rc\.([1-9][0-9]*)$", r"rc\1", tag.removeprefix("v"))
|
|
73
|
+
if version != expected:
|
|
74
|
+
raise SystemExit(
|
|
75
|
+
f"release tag {tag!r} resolves to version {version!r}, expected {expected!r}"
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
print(f"building gearu {version}")
|
|
79
|
+
PY
|
|
80
|
+
|
|
81
|
+
- name: Build and check distributions
|
|
82
|
+
run: |
|
|
83
|
+
python -m pip install --upgrade build twine
|
|
84
|
+
python -m build
|
|
85
|
+
python -m twine check dist/*
|
|
86
|
+
|
|
87
|
+
- name: Smoke-test wheel
|
|
88
|
+
run: |
|
|
89
|
+
python -m pip install dist/*.whl
|
|
90
|
+
python -c "import gearu; print(f'import gearu {gearu.__version__} OK')"
|
|
91
|
+
gearu --version
|
|
92
|
+
|
|
93
|
+
- name: Upload distributions
|
|
94
|
+
uses: actions/upload-artifact@v7
|
|
95
|
+
with:
|
|
96
|
+
name: dist
|
|
97
|
+
path: dist/*
|
|
98
|
+
|
|
99
|
+
pypi-publish:
|
|
100
|
+
name: Publish to PyPI
|
|
101
|
+
runs-on: ubuntu-latest
|
|
102
|
+
needs:
|
|
103
|
+
- test
|
|
104
|
+
- build
|
|
105
|
+
permissions:
|
|
106
|
+
id-token: write
|
|
107
|
+
|
|
108
|
+
environment:
|
|
109
|
+
name: pypi
|
|
110
|
+
url: https://pypi.org/p/gearu
|
|
111
|
+
|
|
112
|
+
steps:
|
|
113
|
+
- name: Download distributions
|
|
114
|
+
uses: actions/download-artifact@v8
|
|
115
|
+
with:
|
|
116
|
+
name: dist
|
|
117
|
+
path: dist
|
|
118
|
+
|
|
119
|
+
- name: Publish release distributions
|
|
120
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
121
|
+
with:
|
|
122
|
+
packages-dir: dist/
|
gearu-0.1.1/.gitignore
ADDED
gearu-0.1.1/AGENTS.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# AGENTS
|
|
2
|
+
|
|
3
|
+
These rules apply to work in this repository.
|
|
4
|
+
|
|
5
|
+
- Work TDD-first for behavior changes: failing test, implementation, green
|
|
6
|
+
tests, then refactor.
|
|
7
|
+
- Preserve target manifest formatting and comments when updating versions or
|
|
8
|
+
dependency pins.
|
|
9
|
+
- Keep ecosystem-specific behavior behind narrow adapters. Shared release
|
|
10
|
+
orchestration must not contain Cargo-, Python-, or npm-specific branching.
|
|
11
|
+
|
|
12
|
+
<!-- gearu:agents:start -->
|
|
13
|
+
## Releases
|
|
14
|
+
|
|
15
|
+
- This repository uses [Gearu](https://owebeeone.github.io/gearu/) for release
|
|
16
|
+
preparation.
|
|
17
|
+
- Read `RELEASE.md` before planning or performing a release.
|
|
18
|
+
- `gearu plan VERSION` and `gearu plan --bump LEVEL` are read-only. Do not run
|
|
19
|
+
`gearu release`, push a release tag, or create a GitHub Release unless the
|
|
20
|
+
user explicitly requests it.
|
|
21
|
+
- Never move or reuse a release tag. Correct released content with a new version.
|
|
22
|
+
- Never publish directly to PyPI, crates.io, or npm from a local checkout.
|
|
23
|
+
Registry publication belongs in the repository's release workflow.
|
|
24
|
+
<!-- gearu:agents:end -->
|
gearu-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gianni Mariani
|
|
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.
|
|
22
|
+
|
gearu-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gearu
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Make repositories ready for release.
|
|
5
|
+
Author-email: Gianni Mariani <gianni@mariani.ws>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/owebeeone/gearu
|
|
8
|
+
Project-URL: Repository, https://github.com/owebeeone/gearu
|
|
9
|
+
Keywords: release,versioning,automation,git,packaging
|
|
10
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
16
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# Gearu
|
|
23
|
+
|
|
24
|
+
**Make repositories ready for release.**
|
|
25
|
+
|
|
26
|
+
Gearu is a small, explicit release-preparation tool for Python, Rust, and npm
|
|
27
|
+
projects. Its name comes from Old English *gearu*: ready, prepared, or equipped.
|
|
28
|
+
|
|
29
|
+
Documentation: <https://owebeeone.github.io/gearu/>
|
|
30
|
+
|
|
31
|
+
Gearu takes an intended version and makes the repository mechanically ready to
|
|
32
|
+
release:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
gearu plan 0.1.0
|
|
36
|
+
gearu release 0.1.0
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Or select the next semantic version from configured package versions and valid
|
|
40
|
+
local and remote release tags:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
gearu plan --bump minor
|
|
44
|
+
gearu release --bump minor
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`plan` verifies and reports without changing tracked files or remote state.
|
|
48
|
+
`release` builds and tests a candidate in a temporary worktree, then creates the
|
|
49
|
+
local release commit and immutable tag. External actions are always explicit:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
gearu release 0.1.0 --push
|
|
53
|
+
gearu release 0.1.0 --push --github-release
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Boundaries
|
|
57
|
+
|
|
58
|
+
Gearu is responsible for:
|
|
59
|
+
|
|
60
|
+
- verifying repository, branch, commit, remote tag, and dependency-tag state;
|
|
61
|
+
- updating versions, lockfiles, and configured dependency pins;
|
|
62
|
+
- running project-specific release checks;
|
|
63
|
+
- creating a release commit and immutable tag;
|
|
64
|
+
- atomically pushing the commit and tag to one repository; and
|
|
65
|
+
- creating the GitHub Release that starts that repository's publish workflow.
|
|
66
|
+
|
|
67
|
+
Gearu does not publish packages directly to PyPI, crates.io, or npm. Registry
|
|
68
|
+
credentials and publication remain in GitHub Actions, triggered by the
|
|
69
|
+
`release.published` event.
|
|
70
|
+
|
|
71
|
+
Cross-repository release trains are ordered and verified, but cannot be atomic:
|
|
72
|
+
Git only provides atomic pushes within a single remote.
|
|
73
|
+
|
|
74
|
+
## Install
|
|
75
|
+
|
|
76
|
+
Once the first release is published:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
uv tool install gearu
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
For development:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
uv sync
|
|
86
|
+
uv run python run_tests.py
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Bootstrap release guidance
|
|
90
|
+
|
|
91
|
+
From any Git repository, run:
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
gearu init
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
This creates or updates managed Gearu sections in `AGENTS.md` and `RELEASE.md`.
|
|
98
|
+
The short agent rule points to the full repository release instructions, which
|
|
99
|
+
cover installation, documentation, planning, local preparation, pushing,
|
|
100
|
+
GitHub Release creation, and recovery. Existing repository-specific content is
|
|
101
|
+
preserved, and repeated runs produce no changes.
|
|
102
|
+
|
|
103
|
+
`init` does not require `gearu.toml`; it can be the first Gearu setup step.
|
|
104
|
+
|
|
105
|
+
## Configure
|
|
106
|
+
|
|
107
|
+
Add `gearu.toml` to the target repository:
|
|
108
|
+
|
|
109
|
+
```toml
|
|
110
|
+
[project]
|
|
111
|
+
name = "example"
|
|
112
|
+
branch = "main"
|
|
113
|
+
remote = "origin"
|
|
114
|
+
tag_prefix = "v"
|
|
115
|
+
github_repo = "owner/example"
|
|
116
|
+
# Optional for repositories that cut releases from a maintained release branch:
|
|
117
|
+
# source_branch = "main"
|
|
118
|
+
|
|
119
|
+
[python]
|
|
120
|
+
manifest = "pyproject.toml"
|
|
121
|
+
version = "static"
|
|
122
|
+
|
|
123
|
+
[release]
|
|
124
|
+
checks = [["python", "-m", "pytest", "-q"]]
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Use `[python]` with `version = "scm"` for tag-derived versions. Rust projects
|
|
128
|
+
use `[rust]` with `manifests = ["Cargo.toml"]`; npm projects use `[npm]` with
|
|
129
|
+
`manifest = "package.json"`. Lockfile refresh commands are configurable and run
|
|
130
|
+
only when their ecosystem manifest changes.
|
|
131
|
+
|
|
132
|
+
Cross-repository release dependencies can verify a remote tag and update an
|
|
133
|
+
inline TOML pin:
|
|
134
|
+
|
|
135
|
+
```toml
|
|
136
|
+
[[dependencies]]
|
|
137
|
+
name = "example-core"
|
|
138
|
+
url = "https://github.com/owner/example-core"
|
|
139
|
+
tag = "{tag}"
|
|
140
|
+
pin_file = "Cargo.toml"
|
|
141
|
+
pin_key = "dependencies.example-core"
|
|
142
|
+
pin_field = "tag"
|
|
143
|
+
# Optional: prove Cargo.lock pins this package to the resolved tag commit.
|
|
144
|
+
lock_package = "example-core"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Override a same-version dependency deliberately with
|
|
148
|
+
`--dependency-tag example-core=v1.1.0`.
|
|
149
|
+
|
|
150
|
+
See [Configuration](docs/Configuration.md) for the complete schema and
|
|
151
|
+
[Release Process](docs/ReleaseProcess.md) for the end-to-end operator flow and
|
|
152
|
+
recovery rules.
|
|
153
|
+
|
|
154
|
+
## Release model
|
|
155
|
+
|
|
156
|
+
Gearu itself is published only by
|
|
157
|
+
[`.github/workflows/publish.yml`](.github/workflows/publish.yml) after a GitHub
|
|
158
|
+
Release is published. PyPI authentication uses Trusted Publishing; no PyPI API
|
|
159
|
+
token is stored in the repository.
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
[MIT](LICENSE)
|
gearu-0.1.1/README.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Gearu
|
|
2
|
+
|
|
3
|
+
**Make repositories ready for release.**
|
|
4
|
+
|
|
5
|
+
Gearu is a small, explicit release-preparation tool for Python, Rust, and npm
|
|
6
|
+
projects. Its name comes from Old English *gearu*: ready, prepared, or equipped.
|
|
7
|
+
|
|
8
|
+
Documentation: <https://owebeeone.github.io/gearu/>
|
|
9
|
+
|
|
10
|
+
Gearu takes an intended version and makes the repository mechanically ready to
|
|
11
|
+
release:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
gearu plan 0.1.0
|
|
15
|
+
gearu release 0.1.0
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or select the next semantic version from configured package versions and valid
|
|
19
|
+
local and remote release tags:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
gearu plan --bump minor
|
|
23
|
+
gearu release --bump minor
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`plan` verifies and reports without changing tracked files or remote state.
|
|
27
|
+
`release` builds and tests a candidate in a temporary worktree, then creates the
|
|
28
|
+
local release commit and immutable tag. External actions are always explicit:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
gearu release 0.1.0 --push
|
|
32
|
+
gearu release 0.1.0 --push --github-release
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Boundaries
|
|
36
|
+
|
|
37
|
+
Gearu is responsible for:
|
|
38
|
+
|
|
39
|
+
- verifying repository, branch, commit, remote tag, and dependency-tag state;
|
|
40
|
+
- updating versions, lockfiles, and configured dependency pins;
|
|
41
|
+
- running project-specific release checks;
|
|
42
|
+
- creating a release commit and immutable tag;
|
|
43
|
+
- atomically pushing the commit and tag to one repository; and
|
|
44
|
+
- creating the GitHub Release that starts that repository's publish workflow.
|
|
45
|
+
|
|
46
|
+
Gearu does not publish packages directly to PyPI, crates.io, or npm. Registry
|
|
47
|
+
credentials and publication remain in GitHub Actions, triggered by the
|
|
48
|
+
`release.published` event.
|
|
49
|
+
|
|
50
|
+
Cross-repository release trains are ordered and verified, but cannot be atomic:
|
|
51
|
+
Git only provides atomic pushes within a single remote.
|
|
52
|
+
|
|
53
|
+
## Install
|
|
54
|
+
|
|
55
|
+
Once the first release is published:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
uv tool install gearu
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
For development:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
uv sync
|
|
65
|
+
uv run python run_tests.py
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Bootstrap release guidance
|
|
69
|
+
|
|
70
|
+
From any Git repository, run:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
gearu init
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
This creates or updates managed Gearu sections in `AGENTS.md` and `RELEASE.md`.
|
|
77
|
+
The short agent rule points to the full repository release instructions, which
|
|
78
|
+
cover installation, documentation, planning, local preparation, pushing,
|
|
79
|
+
GitHub Release creation, and recovery. Existing repository-specific content is
|
|
80
|
+
preserved, and repeated runs produce no changes.
|
|
81
|
+
|
|
82
|
+
`init` does not require `gearu.toml`; it can be the first Gearu setup step.
|
|
83
|
+
|
|
84
|
+
## Configure
|
|
85
|
+
|
|
86
|
+
Add `gearu.toml` to the target repository:
|
|
87
|
+
|
|
88
|
+
```toml
|
|
89
|
+
[project]
|
|
90
|
+
name = "example"
|
|
91
|
+
branch = "main"
|
|
92
|
+
remote = "origin"
|
|
93
|
+
tag_prefix = "v"
|
|
94
|
+
github_repo = "owner/example"
|
|
95
|
+
# Optional for repositories that cut releases from a maintained release branch:
|
|
96
|
+
# source_branch = "main"
|
|
97
|
+
|
|
98
|
+
[python]
|
|
99
|
+
manifest = "pyproject.toml"
|
|
100
|
+
version = "static"
|
|
101
|
+
|
|
102
|
+
[release]
|
|
103
|
+
checks = [["python", "-m", "pytest", "-q"]]
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Use `[python]` with `version = "scm"` for tag-derived versions. Rust projects
|
|
107
|
+
use `[rust]` with `manifests = ["Cargo.toml"]`; npm projects use `[npm]` with
|
|
108
|
+
`manifest = "package.json"`. Lockfile refresh commands are configurable and run
|
|
109
|
+
only when their ecosystem manifest changes.
|
|
110
|
+
|
|
111
|
+
Cross-repository release dependencies can verify a remote tag and update an
|
|
112
|
+
inline TOML pin:
|
|
113
|
+
|
|
114
|
+
```toml
|
|
115
|
+
[[dependencies]]
|
|
116
|
+
name = "example-core"
|
|
117
|
+
url = "https://github.com/owner/example-core"
|
|
118
|
+
tag = "{tag}"
|
|
119
|
+
pin_file = "Cargo.toml"
|
|
120
|
+
pin_key = "dependencies.example-core"
|
|
121
|
+
pin_field = "tag"
|
|
122
|
+
# Optional: prove Cargo.lock pins this package to the resolved tag commit.
|
|
123
|
+
lock_package = "example-core"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Override a same-version dependency deliberately with
|
|
127
|
+
`--dependency-tag example-core=v1.1.0`.
|
|
128
|
+
|
|
129
|
+
See [Configuration](docs/Configuration.md) for the complete schema and
|
|
130
|
+
[Release Process](docs/ReleaseProcess.md) for the end-to-end operator flow and
|
|
131
|
+
recovery rules.
|
|
132
|
+
|
|
133
|
+
## Release model
|
|
134
|
+
|
|
135
|
+
Gearu itself is published only by
|
|
136
|
+
[`.github/workflows/publish.yml`](.github/workflows/publish.yml) after a GitHub
|
|
137
|
+
Release is published. PyPI authentication uses Trusted Publishing; no PyPI API
|
|
138
|
+
token is stored in the repository.
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
[MIT](LICENSE)
|
gearu-0.1.1/RELEASE.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Release Process
|
|
2
|
+
|
|
3
|
+
<!-- gearu:release:start -->
|
|
4
|
+
## Gearu Release Process
|
|
5
|
+
|
|
6
|
+
Gearu prepares and verifies the repository, creates an immutable tag, and can
|
|
7
|
+
create the GitHub Release that starts this repository's publication workflow.
|
|
8
|
+
It does not publish directly to package registries.
|
|
9
|
+
|
|
10
|
+
Full documentation: <https://owebeeone.github.io/gearu/>
|
|
11
|
+
|
|
12
|
+
### Install
|
|
13
|
+
|
|
14
|
+
Install the released tool with:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
uv tool install gearu
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Upgrade an existing installation with:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
uv tool upgrade gearu
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
To test the unreleased `main` branch, install it directly from its repository:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
uv tool install git+https://github.com/owebeeone/gearu.git
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Verify the installation with `gearu --version`.
|
|
33
|
+
|
|
34
|
+
### Preconditions
|
|
35
|
+
|
|
36
|
+
- Read `gearu.toml` and this repository's release workflow.
|
|
37
|
+
- Choose an explicit release version or an explicit major, minor, or patch bump.
|
|
38
|
+
Gearu does not infer release intent from commits.
|
|
39
|
+
- Use a clean checkout on the branch configured by `project.branch`.
|
|
40
|
+
- Synchronize configured release and source branches with their remote.
|
|
41
|
+
- Release required cross-repository dependencies first.
|
|
42
|
+
- Install and authenticate `gh` before requesting GitHub Release creation.
|
|
43
|
+
|
|
44
|
+
### Plan
|
|
45
|
+
|
|
46
|
+
Always inspect the read-only plan first:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
gearu plan VERSION
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or ask Gearu to select the next version:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
gearu plan --bump patch
|
|
56
|
+
gearu plan --bump minor
|
|
57
|
+
gearu plan --bump major
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Gearu compares configured package versions with valid local and remote release
|
|
61
|
+
tags, then bumps the highest version. It reads remote tags directly and does not
|
|
62
|
+
fetch or create local tags while planning.
|
|
63
|
+
|
|
64
|
+
For a release candidate, use a numbered version such as `1.2.3-rc.1`.
|
|
65
|
+
|
|
66
|
+
Override a configured dependency tag only when the release intentionally uses a
|
|
67
|
+
different version:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
gearu plan VERSION --dependency-tag DEPENDENCY=TAG
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Prepare the Local Release
|
|
74
|
+
|
|
75
|
+
After reviewing the plan:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
gearu release VERSION
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The release command can select the version itself:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
gearu release --bump minor
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
This recalculates the next version at release time. To lock the version reviewed
|
|
88
|
+
in a prior bump plan, pass that plan's reported `VERSION` explicitly.
|
|
89
|
+
|
|
90
|
+
Gearu builds and tests in a temporary worktree. Only a successful candidate is
|
|
91
|
+
applied to the local release branch and tagged. This step does not change a
|
|
92
|
+
remote repository.
|
|
93
|
+
|
|
94
|
+
### Push and Create the GitHub Release
|
|
95
|
+
|
|
96
|
+
Push the exact release commit and tag atomically:
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
gearu release VERSION --push
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Create the GitHub Release after that push:
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
gearu release VERSION --push --github-release
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The final command starts workflows listening for `release.published`, including
|
|
109
|
+
package publication and documentation deployment where configured.
|
|
110
|
+
|
|
111
|
+
### Recovery
|
|
112
|
+
|
|
113
|
+
- If candidate checks fail, fix the problem and rerun; the normal checkout is
|
|
114
|
+
left unchanged.
|
|
115
|
+
- If local preparation succeeds, rerun the same version with `--push`.
|
|
116
|
+
- If the push succeeds but GitHub Release creation fails, rerun with
|
|
117
|
+
`--push --github-release`.
|
|
118
|
+
- If released contents must change, use a new patch or release-candidate version.
|
|
119
|
+
Never move or replace the existing tag.
|
|
120
|
+
- If only a publication workflow fails, repair and rerun that workflow for the
|
|
121
|
+
same GitHub Release.
|
|
122
|
+
<!-- gearu:release:end -->
|