Merge a PR updating .github/workflows/release_drafter.yml. The deploy job needs to be given id-token: write permissions, and changed to use the pypa/gh-action-pypi-publish action (see example here).
Delete the old PyPI API tokens, from both PyPI and the GitHub repository secrets settings.
I can make a PR for (2), but do not have access to do (1) and (3). Someone else will have to do those.
Right now we have a trusted publisher configured on PyPI but our deploy workflow still uses
twine
and its secret token to upload new releases.We should update the workflow file to remove the use of
twine
in favour of thepypa/gh-action-pypi-publish@release
action as described here.