PUBLISHING.md•4.28 kB
# Publishing Guide
This guide explains how to publish SCS-MCP to PyPI and npm registries.
## Prerequisites
1. Create accounts on:
- [PyPI](https://pypi.org/account/register/)
- [npm](https://www.npmjs.com/signup) (for voice assistant)
2. Install publishing tools:
```bash
pip install build twine
npm install -g npm-check-updates
```
## Publishing to PyPI
### 1. Update Version
Update version in:
- `setup.py`
- `pyproject.toml`
- `package.json`
- `src/__init__.py` (create if needed)
### 2. Build Distribution
```bash
# Clean previous builds
rm -rf dist/ build/ *.egg-info
# Build source and wheel distributions
python -m build
# Check the distribution
twine check dist/*
```
### 3. Test on TestPyPI (Optional)
```bash
# Upload to TestPyPI
twine upload --repository testpypi dist/*
# Test installation
pip install --index-url https://test.pypi.org/simple/ scs-mcp
```
### 4. Upload to PyPI
```bash
# Upload to PyPI
twine upload dist/*
# Verify installation
pip install scs-mcp
```
## Publishing Voice Assistant to npm
### 1. Update Voice Assistant Version
```bash
cd voice-assistant
npm version patch # or minor/major
```
### 2. Build and Test
```bash
npm run build # if build script exists
npm test
```
### 3. Publish to npm
```bash
npm login
npm publish
```
## GitHub Release
### 1. Create Git Tag
```bash
git tag -a v1.0.0 -m "Release version 1.0.0"
git push origin v1.0.0
```
### 2. Create GitHub Release
1. Go to GitHub repository
2. Click "Releases" → "Create a new release"
3. Choose the tag you created
4. Add release notes from CHANGELOG.md
5. Attach built distributions (optional)
6. Publish release
## Automated Publishing (GitHub Actions)
Add this workflow to `.github/workflows/publish.yml`:
```yaml
name: Publish Package
on:
release:
types: [published]
jobs:
publish-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Publish voice assistant
working-directory: ./voice-assistant
run: |
npm ci
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
```
## Package Naming
- **PyPI**: `scs-mcp` (as configured)
- **npm**: `@scs-mcp/voice-assistant` (scoped package recommended)
## Version Management
Follow semantic versioning:
- **MAJOR** (1.0.0): Breaking changes
- **MINOR** (0.1.0): New features, backwards compatible
- **PATCH** (0.0.1): Bug fixes
## Pre-release Checklist
- [ ] All tests passing
- [ ] Documentation updated
- [ ] CHANGELOG.md updated
- [ ] Version bumped in all files
- [ ] GitHub issues/PRs linked in changelog
- [ ] Security vulnerabilities checked
- [ ] Dependencies updated
- [ ] Examples tested
## Post-release Tasks
- [ ] Verify package installation works
- [ ] Update documentation with new version
- [ ] Announce release (Discord, Twitter, etc.)
- [ ] Close related GitHub issues
- [ ] Plan next release features
## Troubleshooting
### PyPI Upload Errors
- **Invalid credentials**: Create API token at https://pypi.org/manage/account/token/
- **Package exists**: Increment version number
- **Invalid package**: Run `twine check dist/*`
### npm Publish Errors
- **Not logged in**: Run `npm login`
- **Version exists**: Run `npm version patch`
- **Permissions**: Check npm account permissions
## Maintenance
### Update Dependencies
```bash
# Python
pip list --outdated
pip-upgrade requirements.txt
# Node.js
npm outdated
npm update
```
### Security Audits
```bash
# Python
pip install safety
safety check
# Node.js
npm audit
npm audit fix
```
---
For questions about publishing, open an issue or contact the maintainers.