Skip to content

Commit dcfd7e1

Browse files
tbitcsoz-agent
andcommitted
feat: dev releases from develop branch to PyPI
- New workflow: .github/workflows/dev-release.yml - Triggers on every push to develop (+ manual dispatch) - Calculates version: X.Y.Z.devN (N = commits since last tag) - Patches pyproject.toml at build time (source stays clean) - Publishes to PyPI via OIDC (same pypi environment) - Install dev builds: pip install --pre specsmith - Updated docs/site/releasing.md: dev release process documented - Updated WARP rules: dev releases are automatic, stable via tags only Stable releases remain tag-triggered from main only. Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent 9c41335 commit dcfd7e1

3 files changed

Lines changed: 77 additions & 4 deletions

File tree

.github/workflows/dev-release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Dev Release
2+
3+
on:
4+
push:
5+
branches: [develop]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
dev-build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
17+
- uses: actions/setup-python@v6
18+
with:
19+
python-version: "3.12"
20+
cache: pip
21+
22+
- name: Install build tools
23+
run: pip install build
24+
25+
- name: Set dev version
26+
run: |
27+
# Append .devN suffix based on commit count since last tag
28+
BASE_VERSION=$(python -c "from specsmith import __version__; print(__version__)")
29+
COMMIT_COUNT=$(git rev-list --count HEAD ^$(git describe --tags --abbrev=0 2>/dev/null || echo HEAD~100))
30+
DEV_VERSION="${BASE_VERSION}.dev${COMMIT_COUNT}"
31+
echo "DEV_VERSION=${DEV_VERSION}" >> $GITHUB_ENV
32+
33+
# Patch pyproject.toml with dev version
34+
sed -i "s/version = \"${BASE_VERSION}\"/version = \"${DEV_VERSION}\"/" pyproject.toml
35+
echo "Building version: ${DEV_VERSION}"
36+
37+
- run: python -m build
38+
39+
- name: Upload build artifacts
40+
uses: actions/upload-artifact@v7
41+
with:
42+
name: dev-dist
43+
path: dist/
44+
45+
pypi-dev-publish:
46+
needs: dev-build
47+
runs-on: ubuntu-latest
48+
environment: pypi
49+
permissions:
50+
id-token: write
51+
continue-on-error: true
52+
steps:
53+
- uses: actions/download-artifact@v8
54+
with:
55+
name: dev-dist
56+
path: dist/
57+
- name: Publish dev release to PyPI
58+
uses: pypa/gh-action-pypi-publish@release/v1

.warp/rules/documentation-updates.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ Before every release:
5656

5757
## Branch Protection
5858

59-
- **NEVER tag a release on develop.** Tags must only be created on main.
60-
- **NEVER push tags from develop.** The release workflow publishes to PyPI — only main branch releases are allowed.
61-
- All feature work happens on develop. Releases merge develop → main first, then tag on main.
62-
- The release workflow has an `if:` guard but this is a process rule, not just a technical one.
59+
- **NEVER tag a stable release on develop.** Tags must only be created on main.
60+
- **NEVER push tags from develop.** The stable release workflow publishes to PyPI — only main branch releases are allowed.
61+
- All feature work happens on develop. Stable releases merge develop → main first, then tag on main.
62+
- **Dev releases are automatic.** Every push to develop triggers `.devN` pre-release to PyPI.
63+
- Dev releases use `X.Y.Z.devN` version suffix and require `pip install --pre` to install.
6364

6465
## Rule
6566

docs/site/releasing.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,26 @@ After pushing the tag:
148148

149149
## Automated Publishing
150150

151+
### Stable Releases (main branch)
151152
When a tag matching `v*` is pushed to `main`, the release workflow automatically:
152153

153154
1. **Builds** sdist + wheel
154155
2. **Publishes to PyPI** via OIDC trusted publishing (no tokens needed)
155156
3. **Creates GitHub Release** with auto-generated notes and artifacts
156157

158+
Install: `pip install specsmith`
159+
160+
### Dev Releases (develop branch)
161+
Every push to `develop` triggers the dev-release workflow:
162+
163+
1. **Calculates** dev version: `X.Y.Z.devN` (N = commits since last tag)
164+
2. **Builds** sdist + wheel with dev version
165+
3. **Publishes to PyPI** as a pre-release
166+
167+
Install: `pip install --pre specsmith`
168+
169+
Dev releases let users test features before they ship in a stable release. The `.devN` suffix ensures they sort before the next stable version.
170+
157171
## Lessons Learned
158172

159173
- **PyPI README is baked at upload time** — if README changes after a release, they won't appear on PyPI until the next release. Always finalize README before tagging.

0 commit comments

Comments
 (0)