wasi-master / rich-rst

A reStructuredText renderer for rich
https://rich-rst.readthedocs.io/en/latest/
MIT License
13 stars 3 forks source link

GitHub action publish #16

Closed BrianPugh closed 4 months ago

BrianPugh commented 4 months ago

If I'm making a bunch of PRs, I figured I could at least make the publishing a little easier on your side 😉 .

This github action automatically builds and publishes the project to pypi whenever you create a semver tag. I.e. either via:

git tag v2.0.0
git push --tags

or (my preferred way) through the github releases page.

In order to fully set this up, you have to create a pypi token and add it to this project's Github Actions Secrets.

  1. Login to PyPI and visit https://pypi.org/manage/account/token/?selected_project=rich-rst
  2. Call the token name "Github Actions" (but it honestly doesn't matter). Set the Scope to "Project: rich-rst"
  3. Click the blue "Create token" button.
  4. On this github project page, goto settings>Secrets and variables>Actions.
  5. Click the Green "New Repository secret" button.
  6. Set the name to be exactly PYPI_TOKEN. Copy/paste your token (it should start with pypi-) into the "Secret" field. Click the green "Add secret" button.

And then it should be good to go!

Depends on #15

wasi-master commented 4 months ago

Thanks for the instructions but they were not necessary since I already have this set up for other projects. But the thing is, I like to publish packages myself. I don't know why but I really do like the process of building a version of my project, uploading it to pypi, creating a github tag. It gives me a sense of completion of a task.

Also I release my source and build distributions (wheels) in my github release so I have to build them anyways so publishing isn't a big issue. I also think manually doing these gives me just a bit more control over things.

BrianPugh commented 4 months ago

sounds good!