|
2 | 2 |
|
3 | 3 | ## Requirements |
4 | 4 |
|
5 | | -- Local clone of this repository |
6 | | -- Twine (`pip3 install twine`) |
7 | | -- Account on test.pypi.org |
8 | | -- Account on pypi.org |
| 5 | +- Virtual environment: `[[ -d .venv ]] || virtualenv .venv` |
| 6 | +- Local clone with dev environment: `.venv/bin/pip install -e ".[dev]"` |
| 7 | +- TestPyPI and PyPI accounts with Trusted Publishers configured ([details](https://docs.pypi.org/trusted-publishers/)) |
9 | 8 |
|
10 | | -## Steps |
| 9 | +## Release Process |
11 | 10 |
|
12 | | -1. Ensure the version in __docklib/\_\_init\_\_.py__ has been updated. |
| 11 | +1. **Switch to local dev branch**. |
13 | 12 |
|
14 | | -1. Ensure the change log has been updated and reflects actual release date. |
| 13 | +1. **Update version** in: |
| 14 | + - `docklib/__init__.py` |
| 15 | + - `pyproject.toml` |
15 | 16 |
|
16 | | -1. Merge development branch to main/master branch. |
| 17 | +1. **Update changelog**: |
| 18 | + - Reflect all recent changes |
| 19 | + - Add version number and release date |
| 20 | + - Add `## Unreleased` section |
| 21 | + - Update diff links at bottom |
17 | 22 |
|
18 | | -1. Run docklib unit tests and fix any errors: |
| 23 | +1. **Merge to main** and switch to local main branch. |
19 | 24 |
|
20 | | - managed_python3 -m unittest -v |
| 25 | +1. **Create and push tag**: |
21 | 26 |
|
22 | | -1. Build a new distribution package: |
| 27 | + ```bash |
| 28 | + git tag -a v2.1.1 -m "Release version 2.1.1" |
| 29 | + git push origin v2.1.1 |
| 30 | + ``` |
23 | 31 |
|
24 | | - rm -fv dist/* |
25 | | - python3 setup.py sdist bdist_wheel |
| 32 | +1. **Monitor and approve publication**: |
| 33 | + - Automatically publishes to [TestPyPI](https://test.pypi.org/project/docklib/) for testing |
| 34 | + - GitHub Actions will wait for manual approval to publish to production PyPI |
| 35 | + - Go to [Actions](https://github.com/homebysix/docklib/actions) → "Release" workflow → click "Review deployments" → approve "production" |
26 | 36 |
|
27 | | -1. Upload package to test.pypi.org: |
| 37 | +1. **Create GitHub release** (manual): |
| 38 | + - Go to [Releases](https://github.com/homebysix/docklib/releases) and click "Create a new release" |
| 39 | + - Select the tag (v2.1.1), add release title and description from changelog |
28 | 40 |
|
29 | | - twine upload --repository-url https://test.pypi.org/legacy/ dist/* |
| 41 | +## Manual Fallback |
30 | 42 |
|
31 | | -1. View resulting project on test.pypi.org and make sure it looks good. |
| 43 | +If GitHub Actions fail: |
32 | 44 |
|
33 | | -1. Install test docklib in MacAdmins Python on a test Mac: |
| 45 | +```bash |
| 46 | +# Test and build |
| 47 | +.venv/bin/python -m coverage run -m unittest discover -v tests/ |
| 48 | +.venv/bin/python -m pip install build twine |
| 49 | +.venv/bin/python -m build |
34 | 50 |
|
35 | | - managed_python3 -m pip install --upgrade -i https://test.pypi.org/simple/ docklib |
36 | | - |
37 | | -1. Perform tests - manual for now. |
38 | | - |
39 | | -1. Upload package to pypi.org: |
40 | | - |
41 | | - twine upload dist/* |
42 | | - |
43 | | -1. View resulting project on pypi.org and make sure it looks good. |
44 | | - |
45 | | -1. Install production docklib in MacAdmins Python on a test Mac: |
46 | | - |
47 | | - managed_python3 -m pip install --upgrade docklib |
48 | | - |
49 | | -1. Create new [release](https://github.com/homebysix/docklib/releases) on GitHub. Add notes from change log. |
50 | | - |
51 | | -1. Announce to [dock-management](https://macadmins.slack.com/archives/C17NRH534) and other relevant channels, if desired. |
| 51 | +# Publish |
| 52 | +twine upload --repository testpypi dist/* # Test first |
| 53 | +twine upload dist/* # Then production |
| 54 | +``` |
0 commit comments