Closed tupui closed 2 years ago
One improvement could be to add a check for tag=version in setup.cfg
One improvement could be to add a check for tag=version in
setup.cfg
What do you mean exactly, what should this do?
It would check that the tag you are pushing corresponds to the version set in setup.cfg
.
I've seen this happen a few time and then the deployment fails. So you need to delete the tag, push an update on the file and re tag. But yeah now that I rethink this, it would be the same with the check, still need to fix and redo everything. I had this as an early stop before running lot of tests before deploying.
Alternatively,a simple checklist for the person who does the manual action can also do the job.
Another different approach that I've used and worked ok is to have a makefile. It would test, call something like bumpversion
to set the version->commit->tag and then deploy to PyPi. Adds another tool though and all runs locally. I thought it was maybe too much for this repo but I can do this if you prefer.
@rgommers can I do something else?
Alternatively,a simple checklist for the person who does the manual action can also do the job.
This would be the easiest I think:
setup.cfg
vX.Y
matching the version in setup.cfg
Sounds good to me 👍 Looks like the CI did the release properly 😃
I learned recently that you can use a token instead of your credentials. This way you can create a token just for this project, which is safer in case of any leak/misuse.
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
__token__
is already used as username. let's leave this as is, since it's working.
Related to #32.
Since tags are used, automatic deployment could be setup to ease the release process. This workflow deploy when main is tagged with a new release.
This needs to add credentials as secrets (if not already).
Note that PyPi test is set in this PR, just in case.