New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create automatic publish to PyPi via GitHub actions #1003
base: develop
Are you sure you want to change the base?
Create automatic publish to PyPi via GitHub actions #1003
Conversation
Sorry for the delay. This is pretty cool, thanks. Why does it say token as the username? The github template also puts the username into the secrets. @diox I can't manage the pypi project, so i guess I cannot create a token. Could you do that? Or give me manage privileges (might be good anyway to increase the bus factor :) ) |
No prob @karyon ! Tokens are per package whereas inputting your username and password gives access to all your packages. |
Thanks! though I was rather referring to the syntax |
Ah I'm pretty sure Maybe that's the case for environment variables like |
alright, thanks. @diox, could you create and save that token or give me permissions to do so? |
I created the token and stored in in the repos secret under the tbh while it's nice to see this being automated, this was never the part that was blocking making new releases. The more annoying bit is coming up with a nice changelog - we've looked into automating this in the past and while it helps, there is always some manual work involved to make it a little more coherent and elegant. And of course you still need to bump the version in |
BTW, it would be nice to double down and replace Travis with Github Actions, with the future of Travis for open-source repos looking so grim... |
@diox Not sure if what cookiecutter-django's doing is overkill for changelog (uses GitHub actions and just checks by list of PRs). Another option could be: https://github.com/Michael-F-Bryan/auto-changelog. When it comes to actually getting this to auto commit (i.e. the versioning), take a look at this GitHub action workflow:
This was from https://handsonappsec.medium.com/automerge-github-dependabot-alerts-with-github-actions-7cd6f5763750 You can write some small Python script or regular shell script to bump the version. Obviously you can remove that last part (merge). (Honestly I should probably do this for my own repos...) |
That's just a placeholder to tell PyPI that you're using the API token: https://pypi.org/help/#apitoken
|
If you're busy, you may want to consider this method of publishing to PyPi just to get patches out of the way. Just create a PyPi token on the site for this package, put it in your GitHub secrets with the name PYPI_PASSWORD, and your all set.
That way, you can just create a release via the GitHub website in a couple clicks and be on your way.