vsketch icon indicating copy to clipboard operation
vsketch copied to clipboard

Automatic build, release, and publish (closes #151)

Open DaAwesomeP opened this issue 2 years ago • 5 comments

Description

Build, publish, and release automatically with GitHub Actions. Will not publish (but also won't error) unless PYPI_API_TOKEN secret is set. It will build and test installability every time, but it will only create a GitHub release and push to Pypi on tag pushes.

I also attempted to add setuptools_scm, but Poetry does not support it.

Closes #151

Checklist

  • [x] feature/fix implemented
  • [ ] mypy returns no error
  • [ ] tests added/updated and pytest --runslow succeeds
  • [ ] documentation added/updated and building with no error (make clean && make html in docs/)
  • [ ] examples added/updated
  • [ ] code formatting ok (black and isort)

DaAwesomeP avatar Sep 17 '21 00:09 DaAwesomeP

If I'm not mistaken, this project using poetry, quite a few of those steps could be simplified using poetry build right. That's what I used for vpype at least.

abey79 avatar Sep 17 '21 17:09 abey79

Which steps specifically? Effectively all this does for the wheel and sdist is:

  1. Checkout branch
  2. Install the pip build tool
  3. Build. This is done with pip because that is what pip would do when running pip install vsketch on the user end. The settings in pyproject.toml cause it download poetry and use it as the build backend. I don't think using poetry would necessarily save any steps.
  4. Show a SHA256 signature of the files for verification
  5. Upload the artifacts

It does the additional step of testing that the sdist is actually installable through pip after generating it on all three platforms. I then use a GitHub release action and the official Pypi action to upload to Pypi.

DaAwesomeP avatar Sep 17 '21 17:09 DaAwesomeP

You can see an example tag build here: https://github.com/DaAwesomeP/vsketch/actions/runs/1243632046

DaAwesomeP avatar Sep 17 '21 17:09 DaAwesomeP

just wanted to restart the discussion. Is there anything else that can be done?

vincenzocassaro avatar Jul 25 '22 12:07 vincenzocassaro

Yes, I need to take the time to look into it. I might actually go for a slightly simpler setup similar to what I use for my vpype plug-ins.

That said, this discord conversation makes me question if it's actually a good idea to package/release vsketch.Vsketch and vsk together...

abey79 avatar Jul 30 '22 16:07 abey79