Skip to content

Commit a444c65

Browse files
author
LittleCoinCoin
committed
docs: update release policy for new CI/CD architecture
- Document separate semantic-release and publish workflows - Explain automatic publishing for stable releases (v[0-9]+.[0-9]+.[0-9]+) - Document manual publishing via workflow_dispatch - Add workflow execution flow diagrams - Document key design decisions and rationale - Update contributor guidance for new release process - Remove outdated local versioning commands - Clarify that dev releases are available from GitHub releases docs: update release-policy Update the release policy documentation example to reflect the actual current state of the project: - Package name: hatch-xclam (was: hatch) - Description: Package manager for the Cracking Shells ecosystem - Dependencies: Updated to match current pyproject.toml Update the version information to be a pattern: MAJOR.MINOR.PATCH[-dev.N] (was: 0.4.2) This ensures the documentation accurately represents the project's release configuration and versioning strategy.
1 parent 8342999 commit a444c65

File tree

1 file changed

+111
-47
lines changed

1 file changed

+111
-47
lines changed

docs/articles/devs/contribution_guides/release_policy.md

Lines changed: 111 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,20 @@ The project maintains version information in the primary Python package configur
3030
- No separate `VERSION.meta` or `VERSION` files are used
3131
- Version is automatically updated by semantic-release based on conventional commits
3232

33-
Example from `Hatch/pyproject.toml`:
33+
Example from `pyproject.toml`:
3434

3535
```toml
3636
[project]
37-
name = "hatch"
38-
version = "0.4.2"
39-
description = "Package manager for Model Context Protocol servers"
37+
name = "hatch-xclam"
38+
version = "MAJOR.MINOR.PATCH[-dev.N]"
39+
description = "Package manager for the Cracking Shells ecosystem"
4040
dependencies = [
41-
"hatch-validator>=0.1.0",
42-
"requests>=2.28.0",
41+
"jsonschema>=4.0.0",
42+
"requests>=2.25.0",
43+
"packaging>=20.0",
44+
"docker>=7.1.0",
45+
"pydantic>=2.0.0",
46+
"hatch-validator>=0.8.0"
4347
]
4448
```
4549

@@ -88,41 +92,63 @@ The release automation is configured in `.releaserc.json` using:
8892

8993
## Publishing to PyPI
9094

91-
When a release is created:
92-
1. **Build artifacts** are generated by the semantic-release process
93-
2. **Package is published** to PyPI when the release workflow is enhanced
94-
3. **Dev versions** published on `dev` branch will be pre-releases
95-
4. **Production versions** published on `main` branch will be stable releases
96-
97-
### Enhancement Status
98-
-**PyPI publishing workflow**: Added to `.github/workflows/semantic-release.yml`
99-
-**Trusted publishing**: Configured with GitHub environment
100-
-**Artifact handling**: Dist files built and uploaded before publishing
101-
102-
## How to run and test locally
103-
104-
Quick commands you can run from the repository root (PowerShell examples):
105-
106-
```powershell
107-
# Print current computed version
108-
python versioning/version_manager.py --get
109-
110-
# Update version for a given branch (this writes both files)
111-
python versioning/version_manager.py --update-for-branch dev
112-
113-
# Increment a patch locally (writes both files)
114-
python versioning/version_manager.py --increment patch --branch dev
115-
116-
# Prepare simple VERSION file for a build (convert from VERSION.meta)
117-
python versioning/prepare_version.py
118-
```
119-
120-
Notes:
121-
122-
- After running local updates, commit the updated `VERSION` and `VERSION.meta` if you intend to push the change.
123-
- Prefer letting CI run `--update-for-branch` and perform the commit/tag steps automatically unless you need to perform an explicit offline bump.
124-
125-
## Tag cleanup and maintenance
95+
The publishing workflow is separate from the release workflow to ensure clean separation of concerns:
96+
97+
### Automatic Publishing (Stable Releases)
98+
When a stable release tag is created (matching pattern `v[0-9]+.[0-9]+.[0-9]+`):
99+
1. **Tag push triggers** `.github/workflows/publish.yml`
100+
2. **Code is tested** to ensure tag points to valid code
101+
3. **Package is built** using `python -m build`
102+
4. **Package is published** to PyPI using trusted publishing (OIDC)
103+
104+
Only stable releases are automatically published to PyPI. Development releases (`v0.7.0-dev.X`) are available from GitHub releases.
105+
106+
### Manual Publishing (On-Demand)
107+
For special cases, you can manually publish any tag using workflow dispatch:
108+
109+
1. Go to GitHub Actions → "Publish to PyPI" workflow
110+
2. Click "Run workflow"
111+
3. Provide inputs:
112+
- **tag**: Git tag to publish (e.g., `v1.0.0`)
113+
- **ref**: Optional branch/commit (defaults to `main`)
114+
4. Workflow runs and publishes to PyPI
115+
116+
### Workflow Architecture
117+
- **`.github/workflows/semantic-release.yml`**: Handles testing and automated version bumping on branch pushes
118+
- **`.github/workflows/publish.yml`**: Handles PyPI publication on stable release tags or manual dispatch
119+
120+
### Publishing Status
121+
-**Automatic publishing**: Configured for stable releases (v[0-9]+.[0-9]+.[0-9]+)
122+
-**Manual publishing**: Available via workflow_dispatch
123+
-**Trusted publishing**: Configured with GitHub OIDC environment
124+
-**Idempotent**: Uses `skip-existing: true` to handle retries gracefully
125+
126+
## For Contributors
127+
128+
### Creating a Release
129+
1. Use conventional commits in your pull requests
130+
2. When ready to release, merge to `main` or `dev`
131+
3. Semantic-release automatically:
132+
- Analyzes commits
133+
- Calculates version
134+
- Updates `pyproject.toml`
135+
- Generates changelog
136+
- Creates git tag
137+
- Creates GitHub release
138+
4. Tag creation automatically triggers PyPI publishing (for stable releases)
139+
140+
### Manual Publishing
141+
If you need to publish a specific tag manually:
142+
1. Go to GitHub Actions → "Publish to PyPI"
143+
2. Click "Run workflow"
144+
3. Enter the tag name (e.g., `v1.0.0`)
145+
4. Optionally specify a branch/commit
146+
5. Workflow publishes to PyPI
147+
148+
### Version Information
149+
- Current version is always in `pyproject.toml` under `[project]` section
150+
- Do not manually edit version files - let semantic-release handle it
151+
- Version follows semantic versioning: `MAJOR.MINOR.PATCH`
126152

127153
## Release Commit Examples
128154

@@ -147,10 +173,48 @@ BREAKING CHANGE: Updated package schema version
147173
-**Conventional commits**: Enforced with commitlint
148174
-**Version management**: Automated via `@artessan-devs/sr-uv-plugin`
149175
-**Changelog generation**: Automated
150-
-**GitHub releases**: Automated
151-
-**PyPI publishing**: Needs workflow enhancement
176+
-**GitHub releases**: Automated
177+
-**PyPI publishing**: Fully automated for stable releases
178+
-**Manual publishing**: Available via workflow_dispatch
179+
180+
## Workflow Execution Flow
181+
182+
### Development Workflow (Push to `dev` or `main`)
183+
```
184+
Developer push → semantic-release.yml
185+
├─ test job: Validates code
186+
└─ release job: Creates version bump, changelog, and tag
187+
└─ Tag creation triggers publish.yml
188+
```
189+
190+
### Publishing Workflow (Tag creation)
191+
```
192+
Tag push (v[0-9]+.[0-9]+.[0-9]+) → publish.yml
193+
├─ test job: Validates tag points to valid code
194+
└─ publish-pypi job: Builds and publishes to PyPI
195+
```
196+
197+
### Manual Publishing
198+
```
199+
Workflow dispatch → publish.yml
200+
├─ Accepts tag and optional ref inputs
201+
├─ test job: Validates code
202+
└─ publish-pypi job: Builds and publishes to PyPI
203+
```
204+
205+
## Key Design Decisions
206+
207+
1. **Separate Workflows**: Release creation and publishing are independent workflows
208+
- Prevents double-execution issues
209+
- Allows manual publishing without re-running release logic
210+
- Uses git-native tag triggers instead of text matching
211+
212+
2. **Stable Release Only**: Only tags matching `v[0-9]+.[0-9]+.[0-9]+` are auto-published
213+
- Development releases available from GitHub releases
214+
- Reduces PyPI clutter
215+
- Allows manual publishing of dev versions if needed
152216

153-
## Action Items for v0.7.0 Release
154-
1. ✅ Documentation updates (this task)
155-
2. ⚠ Add PyPI publishing workflow
156-
3. ✅ Ensure all contributors understand conventional commit format
217+
3. **Idempotent Publishing**: `skip-existing: true` configuration
218+
- Handles workflow retries gracefully
219+
- Prevents failures on duplicate versions
220+
- Safe to re-run without side effects

0 commit comments

Comments
 (0)