-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
chore(pypi): publish git-cliff
on PyPI
#158
Conversation
@orhun Took a crack at this mostly following the example of I've set this as a draft since this was an initial effort - I haven't really reviewed everything. |
Codecov ReportPatch and project coverage have no change.
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #158 +/- ##
=======================================
Coverage 44.01% 44.01%
=======================================
Files 12 12
Lines 584 584
=======================================
Hits 257 257
Misses 327 327
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hey @radusuciu, thank you for the implementation! I just had a couple of comments. After those are resolved, we can go ahead to update the documentation and we're pretty much ready. Overall looks great, good job! 💖 Sorry for the late response, I have been busy with other projects and the recent version ( |
Thanks for feedback/corrections! I'll have some time to take a look and incorporate your suggestions this weekend most likely. |
Great, looking forward to it! For testing purposes on another repository, is there a dry-run option available? Otherwise we can simply create RC releases I think. |
One more general question I had: in |
Yes! I think we should be able to use TestPyPI: https://packaging.python.org/en/latest/guides/using-testpypi/.. which I guess isn't fully "dry" in the sense I think you mean, but might be better |
I think it is good this way. We have the NPM packaging in the same structure as well. |
Oh, nice. It is definitely better than a dry run. |
Replied to some comments, there are two items to review still. I think we need to test it out against |
Looks good for testing now, how do we proceed? |
You'll want to make an account with To roll it out, I can think of two options: Option 1
Option 2 If it doesn't work first shot, let's do some testing locally since it'll be faster to iterate than via Actions. |
Seems the publish-pypi:
name: Publish PyPI packaage
runs-on: ubuntu-22.04
needs: [pypi-sdist, publish-binaries]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
MATURIN_REPOSITORY: ${{ vars.USE_TEST_PYPI == 'true' && 'testpypi' || 'pypi' }}
with:
command: upload
args: --skip-existing * Also, just noted a spelling mistake: "packaage" I haven't used |
Just created the accounts and added the API keys as secrets to the repository:
Yeah, I agree that the 2nd option is cleaner and let's go with that!
In that case, we need to use
Looks good, except we need to add a check for using the test repository token if needed I think.
I haven't used it before as well, but looks convenient, let's give it a shot! |
Yes, you're right, like so: env:
MATURIN_PYPI_TOKEN: ${{ vars.USE_TESTPYPI == 'true' && secrets.TESTPYPI_API_TOKEN || secrets.PYPI_API_TOKEN }}
MATURIN_REPOSITORY: ${{ vars.USE_TESTPYPI == 'true' && 'testpypi' || 'pypi' }} note I also suggest renaming the |
Also tweaked verbiage a little
fixes mistake in use of endsWith and startsWith expression syntax. Thanks https://rhysd.github.io/actionlint/!
Just want to note that when I tested locally just now the build command yields an error. $ maturin build --manifest-path git-cliff/Cargo.toml --release --out dist
📦 Including license file "/home/radu/github/git-cliff/LICENSE"
💥 maturin failed
Caused by: Found a directory with the module name (git-cliff) next to Cargo.toml, which indicates a mixed python/rust project, but the directory didn't contain an __init__.py file. I think this will happen in the context of the action too, but I have a fix in mind. |
Changes: - fixes an error with maturin build - makes sure maturin commands are run in directory containing pyproject.toml - manifest path is now specified in pyproject.toml - sdist is now created as a part of the build command
I think we're good to go for real now, so long as all repository secrets and variables are set as discussed. Remaining questions:
|
Cool! I will squash the commits on merge so there is no need :3
If
I guess we will see 🐻 I will take a look at the code and add a review. But before actually testing this with a new release, I would like to release From the semver standpoint, would you say we need to bump minor for these changes since there will be a new package? |
That should work with the downside that you're creating release candidates for something that isn't a core feature -- but because they're rc's it should be fine and not annoying to end-users? Maybe we're splitting hairs here lol, but here are some alternatives I can think of:
Sounds good! Now that you mention it, it should be possible to test this workflow without consequence at least once with the release of
I would agree with that! |
Hi @orhun, after a lot of back and forth, mostly dealing with issues related to paths, I've got a successful run of a pared down action: https://github.com/radusuciu/git-cliff/actions/runs/5123788390. This is my effort on bullet point 2 above which I thought was the simplest way forward. I did also try using Here's the package on TestPyPI: https://test.pypi.org/project/test-pypi-deploy-git-cliff/ I think we are ready for RC |
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.
Sorry for the delay and thank you so much for the implementation/testing! 🐻
No worries! Please feel free to tag me in if there's any issues |
Hey @radusuciu, I created the RC release today and there was a build error: https://github.com/orhun/git-cliff/actions/runs/5911302728/job/16033716352 Can you look into it? 🐻 edit: maybe we can disable |
Just disabled
|
Hmm, most of the references I've come across for this point towards issues installing I was just travelling but jotting down some links for later (may or may not be relevant, I'll look into it more) |
Description
This PR updates the CI/CD for packaging git-cliff for PyPI.
Motivation and Context
Closes #150
How Has This Been Tested?
At time of writing this has not been tested.
Screenshots / Logs (if applicable)
Types of Changes
Checklist: