|
| 1 | +# Release Workflow |
| 2 | + |
| 3 | +This document outlines the steps to create a new release for the `pyspark-data-sources` project. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Ensure you have Poetry installed |
| 8 | +- Ensure you have GitHub CLI installed (optional, for enhanced releases) |
| 9 | +- Ensure you have push access to the repository |
| 10 | +- Ensure all tests pass and the code is ready for release |
| 11 | + |
| 12 | +## Release Steps |
| 13 | + |
| 14 | +### 1. Update Version (Using Poetry Commands) |
| 15 | + |
| 16 | +Use Poetry's built-in version bumping commands: |
| 17 | + |
| 18 | +```bash |
| 19 | +# Bump patch version (0.1.6 → 0.1.7) - for bug fixes |
| 20 | +poetry version patch |
| 21 | + |
| 22 | +# Bump minor version (0.1.6 → 0.2.0) - for new features |
| 23 | +poetry version minor |
| 24 | + |
| 25 | +# Bump major version (0.1.6 → 1.0.0) - for breaking changes |
| 26 | +poetry version major |
| 27 | + |
| 28 | +# Or set a specific version |
| 29 | +poetry version 1.2.3 |
| 30 | +``` |
| 31 | + |
| 32 | +This automatically updates the version in `pyproject.toml`. |
| 33 | + |
| 34 | +### 2. Build and Publish |
| 35 | + |
| 36 | +```bash |
| 37 | +# Build the package |
| 38 | +poetry build |
| 39 | + |
| 40 | +# Publish to PyPI (requires PyPI credentials) |
| 41 | +poetry publish |
| 42 | +``` |
| 43 | + |
| 44 | +### 3. Commit Version Changes |
| 45 | + |
| 46 | +```bash |
| 47 | +# Add the version change |
| 48 | +git add pyproject.toml |
| 49 | + |
| 50 | +# Commit with the current version (automatically retrieved) |
| 51 | +git commit -m "Bump version to $(poetry version -s)" |
| 52 | + |
| 53 | +# Push to main branch |
| 54 | +git push |
| 55 | +``` |
| 56 | + |
| 57 | +### 4. Create GitHub Release |
| 58 | + |
| 59 | +#### Option A: Simple Git Tag |
| 60 | +```bash |
| 61 | +# Create an annotated tag with current version |
| 62 | +git tag -a "v$(poetry version -s)" -m "Release version $(poetry version -s)" |
| 63 | + |
| 64 | +# Push the tag to GitHub |
| 65 | +git push origin "v$(poetry version -s)" |
| 66 | +``` |
| 67 | + |
| 68 | +#### Option B: Rich GitHub Release (Recommended) |
| 69 | +```bash |
| 70 | +# Create a GitHub release with current version |
| 71 | +gh release create "v$(poetry version -s)" \ |
| 72 | + --title "Release v$(poetry version -s)" \ |
| 73 | + --notes "Release notes for version $(poetry version -s)" \ |
| 74 | + --latest |
| 75 | +``` |
| 76 | + |
| 77 | +## Version Numbering |
| 78 | + |
| 79 | +Follow [Semantic Versioning](https://semver.org/): |
| 80 | + |
| 81 | +- **Patch** (`poetry version patch`): Bug fixes, no breaking changes |
| 82 | +- **Minor** (`poetry version minor`): New features, backward compatible |
| 83 | +- **Major** (`poetry version major`): Breaking changes |
| 84 | + |
| 85 | +## Manual Version Update (Alternative) |
| 86 | + |
| 87 | +If you prefer to manually edit `pyproject.toml`: |
| 88 | + |
| 89 | +```toml |
| 90 | +[tool.poetry] |
| 91 | +version = "x.y.z" # Update this line manually |
| 92 | +``` |
| 93 | + |
| 94 | +Then follow steps 2-4 above. |
| 95 | + |
| 96 | +## Release Checklist |
| 97 | + |
| 98 | +- [ ] All tests pass |
| 99 | +- [ ] Documentation is up to date |
| 100 | +- [ ] CHANGELOG.md is updated (if applicable) |
| 101 | +- [ ] Version is bumped using `poetry version [patch|minor|major]` |
| 102 | +- [ ] Package builds successfully (`poetry build`) |
| 103 | +- [ ] Package publishes successfully (`poetry publish`) |
| 104 | +- [ ] Version changes are committed and pushed |
| 105 | +- [ ] GitHub release/tag is created |
| 106 | +- [ ] Release notes are written |
| 107 | + |
| 108 | +## Troubleshooting |
| 109 | + |
| 110 | +### Publishing Issues |
| 111 | +- Ensure you're authenticated with PyPI: `poetry config pypi-token.pypi your-token` |
| 112 | +- Check if the version already exists on PyPI |
| 113 | + |
| 114 | +### Git Tag Issues |
| 115 | +- If tag already exists: `git tag -d "v$(poetry version -s)"` (delete local) and `git push origin :refs/tags/"v$(poetry version -s)"` (delete remote) |
| 116 | +- Ensure you have push permissions to the repository |
| 117 | + |
| 118 | +### GitHub CLI Issues |
| 119 | +- Authenticate: `gh auth login` |
| 120 | +- Check repository access: `gh repo view` |
| 121 | + |
| 122 | +## Useful Poetry Version Commands |
| 123 | + |
| 124 | +```bash |
| 125 | +# Check current version |
| 126 | +poetry version |
| 127 | + |
| 128 | +# Show version number only (useful for scripts) |
| 129 | +poetry version -s |
| 130 | + |
| 131 | +# Preview what the next version would be (without changing it) |
| 132 | +poetry version --dry-run patch |
| 133 | +poetry version --dry-run minor |
| 134 | +poetry version --dry-run major |
| 135 | +``` |
| 136 | + |
| 137 | +## Documentation Releases |
| 138 | + |
| 139 | +The project uses MkDocs with GitHub Pages for documentation. The documentation is automatically built and deployed via GitHub Actions. |
| 140 | + |
| 141 | +### Automatic Documentation Updates |
| 142 | + |
| 143 | +The docs workflow (`.github/workflows/docs.yml`) automatically triggers when you push changes to: |
| 144 | +- `docs/**` - Any documentation files |
| 145 | +- `mkdocs.yml` - MkDocs configuration |
| 146 | +- `pyproject.toml` - Project configuration (version updates) |
| 147 | +- `.github/workflows/docs.yml` - The workflow itself |
| 148 | + |
| 149 | +### Manual Documentation Deployment |
| 150 | + |
| 151 | +You can manually trigger documentation deployment: |
| 152 | + |
| 153 | +```bash |
| 154 | +# Using GitHub CLI |
| 155 | +gh workflow run docs.yml |
| 156 | + |
| 157 | +# Or trigger via GitHub web interface: |
| 158 | +# Go to Actions tab → Deploy MkDocs to GitHub Pages → Run workflow |
| 159 | +``` |
| 160 | + |
| 161 | +### Documentation URLs |
| 162 | + |
| 163 | +- **Live Docs**: https://allisonwang-db.github.io/pyspark-data-sources |
| 164 | +- **Source**: `docs/` directory |
| 165 | +- **Configuration**: `mkdocs.yml` |
| 166 | +- **Workflow**: `.github/workflows/docs.yml` |
| 167 | + |
| 168 | +### Adding New Documentation |
| 169 | + |
| 170 | +1. Create new `.md` files in `docs/` or `docs/datasources/` |
| 171 | +2. Update `mkdocs.yml` navigation if needed |
| 172 | +3. Push to main/master branch |
| 173 | +4. Documentation will auto-deploy via GitHub Actions |
0 commit comments