Skip to content

Commit 63ef99a

Browse files
committed
fix: add develop-specific release-please files and update workflow
- Add .release-please-config-develop.json with prerelease: true - Add .release-please-manifest-develop.json with current version - Remove dynamic file creation from workflow - Files are now committed to repo instead of generated at runtime
1 parent 11497fb commit 63ef99a

4 files changed

Lines changed: 83 additions & 26 deletions

File tree

.github/workflows/release-please.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,6 @@ jobs:
2626
steps:
2727
- uses: actions/checkout@v4
2828

29-
# Create temporary prerelease config and manifest for develop branch
30-
- name: Create prerelease config for develop
31-
if: github.ref == 'refs/heads/develop'
32-
run: |
33-
# Add prerelease settings to the root package (path: ".")
34-
cat .release-please-config.json | jq '.packages["."] += {"prerelease": true, "prerelease-type": "alpha"}' > .release-please-config-develop.json
35-
36-
# Create a separate manifest for develop that tracks the last alpha version
37-
# We need to determine what the last alpha version should be based on the current state
38-
CURRENT_VERSION=$(cat .release-please-manifest.json | jq -r '."."')
39-
echo "Current develop manifest version: $CURRENT_VERSION"
40-
41-
# For develop branch, we want to track alpha versions separately
42-
# Since develop has been releasing stable versions, we need to set up proper alpha tracking
43-
echo "{\".\": \"$CURRENT_VERSION\"}" > .release-please-manifest-develop.json
44-
4529
# Release-please for develop branch (creates alpha prereleases)
4630
- uses: googleapis/release-please-action@v4
4731
if: github.ref == 'refs/heads/develop'
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"release-type": "python",
3+
"include-v-in-tag": true,
4+
"bootstrap-sha": "5ed358b3e2e0fd12dc336133f701b4ba5d8a298c",
5+
"packages": {
6+
".": {
7+
"release-type": "python",
8+
"package-name": "otdf-python",
9+
"prerelease": true,
10+
"prerelease-type": "alpha",
11+
"extra-files": [
12+
"pyproject.toml",
13+
{
14+
"path": "uv.lock",
15+
"type": "toml",
16+
"jsonpath": "$.package[?(@.name.value=='otdf-python')].version"
17+
},
18+
{
19+
"path": "otdf-python-proto/pyproject.toml",
20+
"type": "toml",
21+
"jsonpath": "$.project.version"
22+
},
23+
{
24+
"path": "otdf-python-proto/uv.lock",
25+
"type": "toml",
26+
"jsonpath": "$.package[?(@.name.value=='otdf-python-proto')].version"
27+
}
28+
]
29+
}
30+
},
31+
"changelog-sections": [
32+
{ "type": "feat", "section": "Features", "hidden": false },
33+
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
34+
{ "type": "perf", "section": "Performance Improvements", "hidden": false },
35+
{ "type": "revert", "section": "Reverts", "hidden": false },
36+
{ "type": "docs", "section": "Documentation", "hidden": false },
37+
{ "type": "style", "section": "Styles", "hidden": true },
38+
{ "type": "chore", "section": "Miscellaneous Chores", "hidden": true },
39+
{ "type": "refactor", "section": "Code Refactoring", "hidden": false },
40+
{ "type": "test", "section": "Tests", "hidden": true },
41+
{ "type": "build", "section": "Build System", "hidden": false },
42+
{ "type": "ci", "section": "Continuous Integration", "hidden": true }
43+
]
44+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.3.0"
3+
}

docs/RELEASES.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ This ensures that alpha and stable releases have distinct version numbers and pu
5454
- Creates GitHub release marked as "pre-release"
5555
- Publishes to TestPyPI (if version > 0.3.2)
5656

57+
**Note**: The develop branch uses separate configuration files (`.release-please-config-develop.json` and `.release-please-manifest-develop.json`) to ensure proper alpha version tracking independent of the main branch.
58+
5759
### For Stable Releases (Main Branch)
5860

5961
1. **Merge from develop** (or commit directly):
@@ -75,17 +77,32 @@ This ensures that alpha and stable releases have distinct version numbers and pu
7577

7678
## Version Numbering
7779

80+
### How Version Tracking Works
81+
82+
Release Please uses manifest files to track the "last released version" for each branch:
83+
84+
- **`.release-please-manifest.json`**: Tracks the last stable release from main branch
85+
- **`.release-please-manifest-develop.json`**: Tracks the last alpha release from develop branch
86+
87+
When Release Please runs, it:
88+
1. Reads the manifest to find the last released version
89+
2. Analyzes conventional commits since that version
90+
3. Calculates the next version based on commit types (feat, fix, etc.)
91+
4. For develop branch: Applies alpha suffix due to prerelease configuration
92+
7893
### Alpha Versions (from develop)
79-
- Format: `vX.Y.Z-alpha.N` (e.g., `v1.0.0-alpha.1`, `v1.0.0-alpha.2`)
80-
- Automatically incremented by Release Please
94+
- Format: `vX.Y.Z-alpha.N` (e.g., `v0.3.1-alpha.1`, `v0.3.1-alpha.2`)
95+
- Automatically incremented by Release Please using separate configuration files
8196
- Marked as pre-release on GitHub
8297
- Published to TestPyPI
98+
- Tracked independently from main branch versions
8399

84100
### Stable Versions (from main)
85-
- Format: `vX.Y.Z` (e.g., `v1.0.0`, `v1.0.1`)
101+
- Format: `vX.Y.Z` (e.g., `v0.3.1`, `v0.3.2`)
86102
- Follow semantic versioning
87103
- Marked as stable release on GitHub
88104
- Published to PyPI
105+
- Use main branch configuration files
89106

90107
## Manual Release Triggers
91108

@@ -113,8 +130,8 @@ git commit -m "feat!: redesign SDK API (BREAKING CHANGE)" # Major bump
113130

114131
### Testing Alpha Releases
115132
```bash
116-
# Install from TestPyPI
117-
pip install --index-url https://test.pypi.org/simple/ otdf-python==1.0.0a1
133+
# Install from TestPyPI (alpha versions use the format X.Y.Z-alphaX)
134+
pip install --index-url https://test.pypi.org/simple/ otdf-python==0.3.1a1
118135

119136
# Test functionality
120137
python -c "import otdf_python; print('Alpha version works!')"
@@ -123,7 +140,7 @@ python -c "import otdf_python; print('Alpha version works!')"
123140
### Testing Stable Releases
124141
```bash
125142
# Install from PyPI
126-
pip install otdf-python==1.0.0
143+
pip install otdf-python==0.3.1
127144

128145
# Test functionality
129146
python -c "import otdf_python; print('Stable version works!')"
@@ -149,9 +166,16 @@ Release Please automatically updates version references in both packages using t
149166
- Verify PyPI trusted publisher configuration
150167
- Ensure version doesn't already exist on the target repository
151168

169+
### Release Please Configuration Errors
170+
- **Error: "Missing required manifest versions"**: Ensure both `.release-please-config-develop.json` and `.release-please-manifest-develop.json` are committed to the repository
171+
- **Dynamic file creation errors**: The develop-specific configuration files must exist in the repository, not generated at runtime
172+
- **Wrong branch configuration**: Verify the workflow uses the correct config and manifest files for each branch
173+
152174
### Version Conflicts
153-
- Alpha and stable releases use different version formats, preventing conflicts
154-
- If conflicts occur, check the Release Please manifest and config files
175+
- Alpha and stable releases use separate configuration and manifest files to prevent conflicts
176+
- Develop branch uses `.release-please-config-develop.json` and `.release-please-manifest-develop.json`
177+
- Main branch uses `.release-please-config.json` and `.release-please-manifest.json`
178+
- If conflicts occur, check the appropriate Release Please configuration files for the target branch
155179

156180
## Emergency Procedures
157181

@@ -166,8 +190,10 @@ git push origin main
166190

167191
## Configuration Files
168192

169-
- `.release-please-config.json`: Main configuration
170-
- `.release-please-manifest.json`: Version tracking
193+
- `.release-please-config.json`: Main branch release configuration (stable releases)
194+
- `.release-please-manifest.json`: Main branch version tracking
195+
- `.release-please-config-develop.json`: Develop branch release configuration (alpha releases)
196+
- `.release-please-manifest-develop.json`: Develop branch version tracking
171197
- `.github/workflows/release-please.yaml`: GitHub Actions workflow
172198

173199
## Support

0 commit comments

Comments
 (0)