-
Notifications
You must be signed in to change notification settings - Fork 33
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
Set version in workflow dispatch #2014
Conversation
.github/workflows/build-wheels.yml
Outdated
@@ -142,5 +144,6 @@ jobs: | |||
repository-url: https://test.pypi.org/legacy/ | |||
|
|||
- name: Upload to pypi | |||
# If we tagged a version release it on PyPI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which one takes precedence here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On release tags upload to both test and pypi. Perhaps I should change it to only upload to PyPI on release. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry - I mean if we set SETUPTOOLS_SCM_PRETEND_VERSION_FOR_TILEDB
then we should probably skip the upload by default to be safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I can definitely do that. What do you think about also adding another input to workflow_dispatch
called upload_to_test_pypi
that would be a boolean value and if we set it to true it would upload otherwise not. This would be the only way to upload to test pypi. Then release to normal pypi would only happen on tag and only if pretend version is not set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the last commit implemented it that way
.github/workflows/build-wheels.yml
Outdated
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
- name: Upload to pypi | ||
if: startsWith(github.ref, 'refs/tags/') | ||
# If we tagged a version release it on PyPI | ||
if: startsWith(github.ref, 'refs/tags/') && inputs.version == '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check !test_pypi
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, because this branch is only executed when TAG is created, thus there is no way to actually set test_pypi
since it is workflow_dispatch
. However, if you would run workflow_dispatch
on specific TAG, there is a change this would get executed. So perhaps it should be there. But uploading to test_pypi does not necessary mean not uploading to pypi and vice versa.
This way we can produce wheels with any version number:
From
workflow-dispatch
with input argument123.1.7
:https://github.com/dudoslav/TileDB-Py/actions/runs/10060209953/job/27807250342#step:3:24
From release triggered by creating tag
700.11.3
:https://github.com/dudoslav/TileDB-Py/actions/runs/10060350710/job/27807753665#step:3:26