diff --git a/README.md b/README.md index a24ba9f..c9bb977 100644 --- a/README.md +++ b/README.md @@ -131,3 +131,38 @@ This requirement helps to keep Blender add-ons separated, as an add-on can import the modules of BAT it needs, then remove them from `sys.modules` and `sys.path` so that other add-ons don't see them. This should reduce problems with various add-ons shipping different versions of BAT. + +## Publishing a New Release + +For uploading packages to PyPi, an API key is required; username+password will +not work. + +First, generate an API token at https://pypi.org/manage/account/token/. Then, +use this token when publishing instead of your username and password. + +As username, use `__token__`. +As password, use the token itself, including the `pypi-` prefix. + +See https://pypi.org/help/#apitoken for help using API tokens to publish. This +is what I have in `~/.pypirc`: + +``` +[distutils] +index-servers = + bat + +# Use `twine upload -r bat` to upload with this token. +[bat] + repository = https://upload.pypi.org/legacy/ + username = __token__ + password = pypi-abc-123-blablabla +``` + +``` +. ./.venv/bin/activate +pip install twine + +poetry build +twine check dist/blender-asset-tracer-1.13.tar.gz dist/blender_asset_tracer-1.13-*.whl +twine upload -r rsa dist/blender-asset-tracer-1.13.tar.gz dist/blender_asset_tracer-1.13-*.whl +``` diff --git a/update_version.sh b/update_version.sh index 89ed169..1ceaaff 100755 --- a/update_version.sh +++ b/update_version.sh @@ -9,11 +9,12 @@ poetry version $1 sed "s/version = '[^']*'/version = '$1'/" -i docs/conf.py sed "s/release = '[^']*'/release = '$1'/" -i docs/conf.py sed "s/__version__\s*=\s*\"[^']*\"/__version__ = \"$1\"/" -i blender_asset_tracer/__init__.py +sed --posix "s/\(dist\/blender[_-]asset[_-]tracer-\)\([0-9.betalphdv-]*[0-9]\)/\1$1/g" -i README.md git diff echo echo "Don't forget to commit and tag:" -echo git commit -m \'Bumped version to $1\' pyproject.toml blender_asset_tracer/__init__.py docs/conf.py +echo git commit -m \'Bumped version to $1\' pyproject.toml blender_asset_tracer/__init__.py docs/conf.py README.md echo git tag -a v$1 -m \'Tagged version $1\' echo echo "Build the package & upload to PyPi using:"