-
-
Notifications
You must be signed in to change notification settings - Fork 541
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
ci: Add publishing workflow with GitHub Actions #69
ci: Add publishing workflow with GitHub Actions #69
Conversation
- name: Install build and twine | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install build 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.
I'm not also installing check-manifest
here as the prune **
strategy from PR #68 (which I like as it is simple and easy to read) doesn't work with check-manifest
at this time (c.f. mgedmin/check-manifest#144)
@marceloprates This is ready for review. I'm more than happy to try to explain anything in here as I realize that I'm just presenting a workflow and CI/CD system that might not be very clear if you've never done something like it before in GitHub Actions. 👍 |
cc @thewchan given this comment RE: Conda-forge #68 (comment) |
* Test building a sdist and wheel on push events and pull request events * List contents of sdist and wheel for visual checks / debugging - Note that check-manifest is currently incompatible with `prune **` strategy * Publish sdists and wheels to TestPyPI through pushed tags triggered through push events * Publish sdists and wheels to PyPI through published release events triggered through GitHub releases
bbb629d
to
1cbad7d
Compare
Dear Matthew, First of all, thank you again for the help. I've merged your PR and followed the instructions:
However, https://test.pypi.org/project/prettymaps/ does not update to v0.1.3 I figure I'm doing something wrong...do you have an idea of what may it be? |
Ah sorry. I think this
should have been (c.f. recast-hep/recast-atlas#63 and I also edited the PR body text for posterity) git push origin main --tags prettymaps/.github/workflows/publish-package.yml Lines 51 to 53 in 9091bd4
is looking for a push event (of commits) that also has a tag associated with it. So when you update the version number to git show HEAD should show you both the number change and the tag. I'm used to setting up Example from one of my projects:
Let me know if that doesn't make sense though. As I made a recommendation that isn't super smooth I'm happy to try to help make things work. |
Ah yeah, okay looking at $ bump2version --commit --tag --current-version v0.1.2 patch setup.py Here's what I get when I run that on my fork: $ git reset --hard 77b992e
$ python -m pip install --upgrade bump2version
$ bump2version --commit --tag --current-version v0.1.2 patch setup.py
$ git show HEAD
commit aacd8ca933de3bc1bc042089ee85b07b5d20006e (HEAD -> main, tag: v0.1.3)
Author: Matthew Feickert <matthew.feickert@cern.ch>
Date: Wed Oct 6 10:06:03 2021 -0500
Bump version: v0.1.2 → 0.1.3
diff --git a/setup.py b/setup.py
index b9a89c5..3402855 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ parent_dir = Path(__file__).resolve().parent
setup(
name="prettymaps",
- version="v0.1.2",
+ version="v0.1.3",
description="A simple python library to draw pretty maps from OpenStreetMap data",
long_description=parent_dir.joinpath("README.md").read_text(),
long_description_content_type="text/markdown", this followed by $ git push --force-with-lease origin master --tags should work to bump off a release to TestPyPI. |
Hi Matthew, Sorry for the late reply. I've followed your steps (although I manually changed the setup.py version number instead of rolling back the commit story) and was able to have bump2version make a new tag (also checked with git show HEAD and in here), but test.pypi still does not update :( |
Apparently it's an issue with the lack of authentication information. Will look into that |
Ah this looks like the API token for TestPyPI isn't saved in the repo secrets under
correctly. Can you just try to update the value of that secret and then retrigger the same workflow? It should pick up the new credentials and then complete if they are valid. Idk if you want to preemptively update the API token for PyPI as well, in the event that both were somehow pasted in with something slightly off. Let me know if you have any questions though. 👍 Also sorry that this hasn't been quite as smoothed as I had hoped. |
Hey Matthew, no need to apologize, on the contrary. I really appreciate your help and was able to learn a little bit more in the process. Thanks a lot! I believe everything went well! Don't actually know what went wrong before, maybe I accidentally copied the PyPi password where the Test PyPi password should be... |
Indeed! Looks great. :) I'll open up another Issue to discuss, but if you're interested I've been experimenting with a GitHub Actions workflow that allows you to be able to generate a new release tag from a button press in GitHub Actions (c.f. recast-hep/recast-atlas#68). So automating away even more of the boring stuff. :) |
Resolves #67
Add GHA based workflow to release a sdist and wheel to:
Things that @marceloprates would need to do for this PR to work:
test_pypi_password
andpypi_password
Example resulting release workflow:
Locally on
main
run:v0.1.0
) in the "Tag version" box and the "Release title" box (to make it easy unless you really want to get descriptive)