-
Notifications
You must be signed in to change notification settings - Fork 21
feat: create pypi publish github action #8
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
Conversation
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.
Due to my lack of knowledge in Github Actions, I'm not very confident but I can understand and imagine what this config file is trying to achieve. 😆 Hope this automates our release process as expected! 🙏
.github/workflows/pythonpublish.yml
Outdated
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 |
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.
Nit: Maybe this step also deserves its name to be consistent with the rest of the steps?
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.
Which branch gets checked out? The default 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.
A name can be added to this step for added clarity 👍
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.
Fair question about which version of the code gets used, took me a bit to find more info on that when I first was getting into it. Basically when a github action gets triggered it will use the git_sha given by that trigger. In the case of the release trigger, it will use the git_sha in the release which should correspond to the version we want to release.
If you want to read more into here, I found the following articles helpful:
General info on workflow triggers - https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#about-workflow-events
Release trigger - https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#release-event-release
.github/workflows/pythonpublish.yml
Outdated
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine |
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.
Does this also install our own dependencies such as requests
? Or, they don't even need to be installed to build the distribution?
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.
I'm not sure 🤔 I haven't seen any docs saying I need to install packages ahead of time, my guess is that the upload / build doesn't require installing dependencies, but let me see if I can find some documentation that explicitly mentions this.
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.
Ok so from quickly testing it out on the legacy pypi server, it seems having the dependencies installed locally is not required for packaging. That's pretty neat!
0feac18
to
92c0d63
Compare
Rebased because I wanted to format the first commit to have yaml that didn't look ugly. Should be good to go now |
What kind of change does this PR introduce?
Feature related to #6.
What is the current behavior?
Currently the release process is as follows:
setup.py
.While this is ok, there are a lot of manual steps to this which could fail due to a manual error.
What is the new behavior?
With github actions, whenever a new release is created for the repository, this github action will trigger and try to build and deploy the package to pypi. The build will use the code based on the git sha of the release.
This change will still require the manual process of upgrading the version number in setup.py before releasing, but it at least removes the manual steps of having to build and deploy the project.
Does this PR introduce a breaking change?
No breaking changes to the project 🎉
Other information