Monorepo Support¶
Release multiple packages from one repository.
Overview¶
releasio supports monorepo layouts where multiple Python packages live in a single repository:
my-monorepo/
├── packages/
│ ├── core/
│ │ ├── pyproject.toml
│ │ └── src/
│ ├── cli/
│ │ ├── pyproject.toml
│ │ └── src/
│ └── web/
│ ├── pyproject.toml
│ └── src/
├── pyproject.toml # Root config
└── .releasio.toml
Configuration¶
Root Configuration¶
.releasio.toml
[packages]
paths = [
"packages/core",
"packages/cli",
"packages/web",
]
# Shared settings
default_branch = "main"
[version]
tag_prefix = "v"
Package-specific Settings¶
Each package can have its own configuration:
Versioning Strategies¶
Independent Versioning¶
Each package has its own version:
packages/core → core-v1.0.0, core-v1.1.0
packages/cli → cli-v2.0.0, cli-v2.0.1
packages/web → web-v0.5.0, web-v0.6.0
Configuration:
Synchronized Versioning¶
All packages share the same version:
Configuration:
Commands¶
Check All Packages¶
Output:
📦 core (packages/core)
Current: core-v1.0.0
Next: core-v1.1.0 (minor)
Changes: 3 commits
📦 cli (packages/cli)
Current: cli-v2.0.0
Next: No changes
📦 web (packages/web)
Current: web-v0.5.0
Next: web-v0.6.0 (minor)
Changes: 2 commits
Release Specific Package¶
Release All Changed¶
Workflow Examples¶
Independent Releases¶
.github/workflows/release.yml
name: Release
on:
push:
branches: [main]
paths:
- 'packages/**'
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.changes.outputs.packages }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect changed packages
id: changes
run: |
# Find packages with changes since last tag
packages=$(releasio check --json | jq -r '.packages | map(select(.has_changes)) | .[].name')
echo "packages=$packages" >> $GITHUB_OUTPUT
release:
needs: detect-changes
if: needs.detect-changes.outputs.packages != ''
runs-on: ubuntu-latest
strategy:
matrix:
package: ${{ fromJson(needs.detect-changes.outputs.packages) }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: mikeleppane/releasio@v2
with:
command: release
working-directory: packages/${{ matrix.package }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Synchronized Releases¶
.github/workflows/release.yml
name: Release All
on:
push:
branches: [main]
jobs:
release:
if: startsWith(github.event.head_commit.message, 'chore(release):')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: mikeleppane/releasio@v2
with:
command: release
github-token: ${{ secrets.GITHUB_TOKEN }}
Tag Formats¶
Independent Tags¶
.releasio.toml
[packages.core]
path = "packages/core"
tag_prefix = "core-v"
[packages.cli]
path = "packages/cli"
tag_prefix = "cli-v"
Results in:
Unified Tags¶
Results in:
Changelog per Package¶
Each package maintains its own changelog:
packages/
├── core/
│ ├── CHANGELOG.md
│ └── pyproject.toml
├── cli/
│ ├── CHANGELOG.md
│ └── pyproject.toml
Configuration:
Dependencies Between Packages¶
Internal Dependencies¶
When cli depends on core:
Synchronized Updates¶
When core releases, cli gets its dependency updated.
Publishing¶
Publish All¶
Publish Specific¶
Skip Publishing¶
Best Practices¶
Directory Structure¶
monorepo/
├── packages/ # All packages here
│ ├── core/
│ ├── cli/
│ └── web/
├── .releasio.toml # Root config
├── .github/
│ └── workflows/
│ └── release.yml
└── README.md
Naming Conventions¶
Commit Scopes¶
Use scopes to identify package:
Troubleshooting¶
Package Not Detected¶
Solution: Verify paths in config:
Wrong Package Tagged¶
Solution: Ensure unique tag prefixes:
Dependency Version Mismatch¶
When internal dependencies get out of sync:
Limitations¶
Current monorepo support:
- Multiple packages in one repo
- Independent or synchronized versioning
- Per-package configuration
- Per-package changelogs
- Automatic dependency graph detection
- Transitive dependency updates
See Also¶
- Configuration Reference - All options
- Multi-branch Releases - Release channels
- GitHub Actions - CI/CD setup