-
Notifications
You must be signed in to change notification settings - Fork 60
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
Automate GitHub releases & PyPI package publication #152
Conversation
This adds a job to the existing GitHub Actions CI.yml workflow that uses AutoPub to automatically release and publish new packages to PyPI when a release file is merged or pushed into the `main` branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks very fancy. 😅
I'd lean to a release on tag kind of flow generally. Is it the case that every PR merged is release worthy? 🤔 (Maybe it is IDK 😜)
The idea is not that every single pull request merits a new release. Indeed, you probably don't want a new release to fix a typo in a code comment or to upgrade a linter dependency version. But thankfully that's not how this system is designed to work. 😊 The deployment machinery is only ever triggered when a
I will add that I find this process to be much easier than messing with Git tags. You just choose Thanks to Florian, who made a number of improvements to the flow, you can see how this is handled in another Django-related project, Kagi. |
Gotcha. That's kind of equivalent then. Sounds good. ("Very fancy" 😉) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (except for the suggestion 🙃)! Thx for your effort!
Done! |
Thanks to Ronny and Carlton for reviewing, and thanks to David for the assistance with the PyPI configuration 💫 |
This pull request adds a job to the existing GitHub Actions
CI.yml
workflow that uses AutoPub to automatically release and publish new packages to PyPI when a release file is merged or pushed into themain
branch.As part of this endeavor, I also took this opportunity to replace the
twine upload
step with PyPI's new Trusted Publisher system. In addition to the changes in this pull request, the only remaining step needed to utilize the Trusted Publisher system is for someone with more permissions than I currently have to do one of the following two things:crispy-tailwind
PyPI project with Owner role (my PyPI username isjmayer
), after which I would be happy to set everything up.Owner:
django-crispy-forms
Repository name:
crispy-tailwind
Workflow name:
CI.yml
Environment name: (optional — can leave this field empty)
Rather than add PDM/Hatch as discussed in #149, I elected to defer that endeavor and instead retain Setuptools as the build back-end for now in an effort to keep the scope as narrow as possible.
Closes #149