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

Actions workflow to release the package #30

Merged
merged 8 commits into from
Aug 3, 2022

Conversation

abitrolly
Copy link
Contributor

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
Copy link
Owner

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
Copy link
Contributor Author

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 yakshaveinc/linux#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
Copy link
Contributor Author

@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
Copy link
Contributor Author

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 fschulze merged commit 0b4faf4 into fschulze:master Aug 3, 2022
@fschulze
Copy link
Owner

fschulze commented Aug 3, 2022

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

@fschulze fschulze mentioned this pull request Aug 3, 2022
@abitrolly abitrolly deleted the patch-1 branch August 3, 2022 11:36
@abitrolly
Copy link
Contributor Author

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

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.

None yet

2 participants