fschulze / sqlalchemy_schemadisplay

Other
143 stars 37 forks source link

Actions workflow to release the package #30

Closed abitrolly closed 2 years ago

abitrolly commented 2 years ago

This adds a button to release the package to https://github.com/fschulze/sqlalchemy_schemadisplay/actions

image

Requires to set PYPI_API_TOKEN in repository secrets in repository settings.

fschulze commented 2 years ago

What is it basing the release on, current HEAD? I would rather like a release upon a tag and a successful test of that tag, otherwise it is way too easy to do something by accident, or are there other contingencies for that?

abitrolly commented 2 years ago

Most likely HEAD from master, but I haven't checked. There is no way to release upon a tag, because GitHub doesn't generate any events when tag is pushed (in https://github.com/yakshaveinc/linux/pull/44).

The most simple approach is to add a check that release is done from master branch, and push the button only after tests in master pass.

It is also possible to move tests into reusable workflow and run them before packing.

And it is also possible to detect if version in master branch is changed compared to PyPI and start the release job in this case.

abitrolly commented 2 years ago

@fschulze

I would rather like a release upon a tag and a successful test of that tag

Reworked to release upon a tag given the instruction at https://github.com/pypa/gh-action-pypi-publish

abitrolly commented 2 years ago

Make Publish depend on successful test run. The only thing I am not sure is that tag test works.

https://stackoverflow.com/questions/58457140/dependencies-between-workflows-on-github-actions

fschulze commented 2 years ago

I had to add some changes to make it work and for now it publishes to https://test.pypi.org/project/sqlalchemy-schemadisplay/

abitrolly commented 2 years ago

Good news. ) Now waiting for updated version at https://pypi.org/project/sqlalchemy-schemadisplay/