I had a fair amount of trouble trying to figure this out.
Here's a link to the tutorial which helped me figure this out:
https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
When following that tutorial, make sure to set up the workflow first,
by clicking on actions (in the repo), then clicking on the make a workflow yourself link.
Then you'll be directed to a main.yaml file, so delete its content.
After all that, add the content mentioned in the tutorial into that yaml file.