Skip to content
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

Add release workflow for GitHub Actions based PyPI package releases #361

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

carlthome
Copy link
Contributor

What?

Introduce a package release workflow for building and distributing mir_eval to PyPI.

Install workflow on PyPI

Login to https://pypi.org/manage/account/publishing/ and fill in github.com repo details under the mir_eval package settings.

Usage of workflow on GitHub

  1. Update package version in Python code.
  2. Create a GitHub Releases release as repo owner here: https://github.com/craffel/mir_eval/releases
  3. Watch the GitHub Actions workflow run. Once ✅ the newly built package should be on PyPI here https://pypi.org/project/mir_eval

@carlthome
Copy link
Contributor Author

It would be nice to get out a patched version that works with latest NumPy so we can pip install mir_eval instead of pip install git+https://github.com/craffel/mir_eval@d68afb0b37bfd0ff48a92fbe1ae1325a182cd471. Perhaps a v0.7.1 or something?

@bmcfee
Copy link
Collaborator

bmcfee commented Aug 7, 2023

I think getting this to work will require @craffel to set up an auth token. See https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ (We did this a few years back for librosa and it works like a charm.)

It would be nice to get out a patched version that works with latest NumPy

Agreed - this should be a separate PR though.

@craffel
Copy link
Collaborator

craffel commented Aug 7, 2023

Thanks @carlthome and @bmcfee . I added an PyPI API key under the key PYPI_API_TOKEN - let me know if that works.

@carlthome
Copy link
Contributor Author

carlthome commented Aug 9, 2023

It's actually preferred to have shortlived tokens now instead, for PyPI with GitHub Actions (GHA) (as per this) so the key cannot leak through PR logs and be abused.

The installation of this GHA workflow would be that you (@craffel) go to https://pypi.org/manage/project/mir_eval/settings/publishing/ and submit that HTML form as per this screenshot:
image

Then we can merge this (at which nothing happens), and once comfortable with releasing a new PyPI package, create a GitHub Releases release which will start the workflow.

@carlthome
Copy link
Contributor Author

Agreed - this should be a separate PR though.

👍

@craffel
Copy link
Collaborator

craffel commented Aug 9, 2023

Cool, added the workflow.
image

@carlthome
Copy link
Contributor Author

carlthome commented Aug 10, 2023

Great! Then this PR can also be merged so the workflow itself is on main.

After that, it would be a matter of bumping https://github.com/craffel/mir_eval/blob/main/setup.py#L8 and filling in https://github.com/craffel/mir_eval/releases/new with the same version number.

@craffel craffel merged commit 9be1c5b into mir-evaluation:main Aug 15, 2023
@craffel
Copy link
Collaborator

craffel commented Aug 15, 2023

Thanks!

@carlthome carlthome deleted the add-release-workflow-to-pypi branch August 15, 2023 15:54
@bmcfee bmcfee added this to the 0.8 milestone Feb 6, 2025
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.

3 participants