Skip to content

Conversation

@jjlawren
Copy link
Collaborator

This is a Github Actions workflow to automatically publish tagged releases to PyPI as described here.

This will require @pkkid to:

  1. Create a new token on PyPI under "Account Settings > API tokens"
  2. Set it as PYPI_TOKEN in the repository's encrypted secrets

More details about the encrypted secrets here: https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets.

@pkkid
Copy link
Collaborator

pkkid commented Mar 30, 2020

Thank you for doing the research here and I'm sorry I have not had time to dedicate here. I'll take a look at these tonight.

@pkkid
Copy link
Collaborator

pkkid commented Mar 30, 2020

The steps from the top comment are complete. Do we need to update the code anyplace now? I can read the pages in more detail later, in Zoom meetings all day, yay!

@jjlawren
Copy link
Collaborator Author

I think this action should work independently. If it's a question regarding the state of the code & outstanding PRs before a new release, I'd have to defer back to you.

@jjlawren
Copy link
Collaborator Author

jjlawren commented Apr 8, 2020

Anything I can help with here @pkkid?

@pkkid
Copy link
Collaborator

pkkid commented Apr 8, 2020

I'm sorry I misinterpreted the comment above, thinking I didn't need to do anything more here yet.

I believe the next steps are to setup a file per these instructions: https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

@Hellowlol @blacktwin - Do we want it to push every time we do a tagged commit (per the example)?

@jjlawren
Copy link
Collaborator Author

jjlawren commented Apr 8, 2020

That's a different process for a similar result. The link above also doesn't seem to handle actually building the package, just publishing. Note from that page: https://github.com/pypa/gh-action-pypi-publish#non-goals.

I reviewed this PR and changed the trigger to only run the Github Action on published releases. So the workflow should be as simple as:

  1. Ensure the token (not username/pass) is stored in this repo's secrets
  2. Commit this Github Action
  3. Publish a new Github release for the project

Once that's done the action should fire, spin up an Ubuntu instance, build the package, and upload it to PyPI using the token.

One thing that I didn't consider is Python 2.x support. This action is only set to build for 3.x and I don't think there's been an explicit announcement of the project's end of support for 2.x. Thoughts?

@Hellowlol
Copy link
Collaborator

Yes, since you are the only one access to the pypi account it would be nice to be able to push a release, some projects cant install from github etc.

@pkkid
Copy link
Collaborator

pkkid commented Apr 9, 2020

@Hellowlol Just added you on PyPi.

@jjlawren
Copy link
Collaborator Author

jjlawren commented Apr 9, 2020

Yes, since you are the only one access to the pypi account it would be nice to be able to push a release, some projects cant install from github etc.

The point of this script is that anyone that can publish a release on github (i.e., collaborators) can also push to PyPI.

I'd think that basing off releases instead of tags will make it easier to keep things in sync. For example, the "missing" 3.3.0 github release.

@jjlawren
Copy link
Collaborator Author

@pkkid @Hellowlol if the PyPI token is in place, are there any objections to merging this PR and creating a 3.4.0 release from the current master?

@Hellowlol
Copy link
Collaborator

I think we should create builds for Python 2 (3.4.0) then merge any outstanding prs, drop py2 and push 4.0.0

@Hellowlol
Copy link
Collaborator

@pkkid yes, it should push a new version on each tag. We have support for this now using travis. But its only released if all tests pass (our tests are to flaky)

@jjlawren jjlawren force-pushed the github_release_action branch from ada9f40 to cfca54b Compare April 17, 2020 01:22
@jjlawren
Copy link
Collaborator Author

Rebased with all the recent test fixes and it passes. Thanks, @Hellowlol!

Since Travis is already capable of pushing to PyPI (if all tests pass), what's the consensus on the necessity of this PR now?

@jjlawren jjlawren mentioned this pull request Nov 18, 2020
5 tasks
@JonnyWong16
Copy link
Collaborator

JonnyWong16 commented Dec 3, 2020

@JonnyWong16
Copy link
Collaborator

JonnyWong16 commented Dec 3, 2020

Change python_requires='>=3.6' in setup.py.

https://github.com/pkkid/python-plexapi/blob/master/setup.py#L38

@jjlawren jjlawren force-pushed the github_release_action branch from cfca54b to e1f14de Compare December 6, 2020 05:11
@codecov-io
Copy link

Codecov Report

Merging #443 (e1f14de) into master (f22fa56) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #443   +/-   ##
=======================================
  Coverage   65.86%   65.86%           
=======================================
  Files          20       20           
  Lines        4137     4137           
=======================================
  Hits         2725     2725           
  Misses       1412     1412           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f22fa56...e1f14de. Read the comment docs.

@jjlawren
Copy link
Collaborator Author

jjlawren commented Dec 6, 2020

Change python_requires='>=3.6' in setup.py.

https://github.com/pkkid/python-plexapi/blob/master/setup.py#L38

Let's do this at the next major release unless there's a reason it has to be done with this PR.

@Hellowlol
Copy link
Collaborator

Travis is gone. Time to merge this?

@jjlawren jjlawren merged commit 5130bc9 into pushingkarmaorg:master Dec 14, 2020
@jjlawren jjlawren deleted the github_release_action branch December 14, 2020 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants