|
| 1 | +# GitHub Actions Workflows |
| 2 | + |
| 3 | +This directory contains the automated workflows for enrichmcp. |
| 4 | + |
| 5 | +## Workflows |
| 6 | + |
| 7 | +### 1. `ci.yml` - Continuous Integration |
| 8 | +- **Triggers**: On every push and pull request |
| 9 | +- **Purpose**: Runs tests, linting, and type checking |
| 10 | +- **Jobs**: |
| 11 | + - Run pytest |
| 12 | + - Run ruff linting |
| 13 | + - Run pyright type checking |
| 14 | + |
| 15 | +### 2. `docs.yml` - Documentation |
| 16 | +- **Triggers**: On push to main or manual trigger |
| 17 | +- **Purpose**: Builds and deploys documentation to GitHub Pages |
| 18 | +- **Note**: Currently configured but may need GitHub Pages setup |
| 19 | + |
| 20 | +### 3. `release.yml` - PyPI Release |
| 21 | +- **Triggers**: When you push a version tag (e.g., `v0.1.0`) |
| 22 | +- **Purpose**: Builds and publishes the package to PyPI |
| 23 | +- **Jobs**: |
| 24 | + 1. Build the distribution packages |
| 25 | + 2. Publish to PyPI (supports both trusted publishing and username/password) |
| 26 | + 3. Create a GitHub release with changelog |
| 27 | + |
| 28 | +### 4. `test-publish.yml` - Test PyPI Publishing |
| 29 | +- **Triggers**: On pushes to main that modify source code |
| 30 | +- **Purpose**: Tests the build and optionally publishes to TestPyPI |
| 31 | +- **Jobs**: |
| 32 | + 1. Build and test the package |
| 33 | + 2. Publish to TestPyPI (only on main branch) |
| 34 | + |
| 35 | +## Setup Instructions |
| 36 | + |
| 37 | +### For PyPI Publishing (release.yml) |
| 38 | + |
| 39 | +You have two options: |
| 40 | + |
| 41 | +#### Option 1: Trusted Publishing (Recommended) |
| 42 | +1. Go to https://pypi.org and log in |
| 43 | +2. Go to your project page (after first manual upload) |
| 44 | +3. Click "Manage" → "Publishing" |
| 45 | +4. Add a new trusted publisher: |
| 46 | + - Owner: `featureform` |
| 47 | + - Repository: `enrichmcp` |
| 48 | + - Workflow: `release.yml` |
| 49 | + - Environment: `pypi` |
| 50 | +5. In GitHub, go to Settings → Environments |
| 51 | +6. Create an environment called `pypi` |
| 52 | +7. Add a variable `USE_TRUSTED_PUBLISHING` with value `true` |
| 53 | + |
| 54 | +#### Option 2: API Token (Classic Method) |
| 55 | +1. Go to https://pypi.org and log in |
| 56 | +2. Go to Account Settings → API tokens |
| 57 | +3. Create a new token (scope to project after first upload) |
| 58 | +4. In GitHub, go to Settings → Secrets and variables → Actions |
| 59 | +5. Add secrets: |
| 60 | + - `PYPI_USERNAME`: `__token__` |
| 61 | + - `PYPI_PASSWORD`: Your PyPI API token |
| 62 | + |
| 63 | +### For TestPyPI Publishing (test-publish.yml) |
| 64 | + |
| 65 | +Similar to above but for test.pypi.org: |
| 66 | +1. Create account at https://test.pypi.org |
| 67 | +2. Set up trusted publishing for the `testpypi` environment |
| 68 | +3. Or use API tokens |
| 69 | + |
| 70 | +## How to Make a Release |
| 71 | + |
| 72 | +1. Make sure you're on the main branch with all changes committed |
| 73 | +2. Update `CHANGELOG.md` (change "Unreleased" to the version number) |
| 74 | +3. Commit the changelog update |
| 75 | +4. Tag the release: |
| 76 | + ```bash |
| 77 | + git tag -a v0.1.0 -m "Release version 0.1.0" |
| 78 | + git push origin main |
| 79 | + git push origin v0.1.0 |
| 80 | + ``` |
| 81 | +5. The `release.yml` workflow will automatically: |
| 82 | + - Build the package |
| 83 | + - Upload to PyPI |
| 84 | + - Create a GitHub release |
| 85 | + |
| 86 | +## Manual Triggers |
| 87 | + |
| 88 | +Some workflows support manual triggers via GitHub's UI: |
| 89 | +1. Go to Actions tab |
| 90 | +2. Select the workflow |
| 91 | +3. Click "Run workflow" |
| 92 | +4. Choose the branch and run |
| 93 | + |
| 94 | +This is available for: |
| 95 | +- `docs.yml` - To manually deploy docs |
| 96 | +- `test-publish.yml` - To manually test publishing |
0 commit comments