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

Set version in workflow dispatch #2014

Merged
merged 3 commits into from
Jul 25, 2024
Merged

Set version in workflow dispatch #2014

merged 3 commits into from
Jul 25, 2024

Conversation

dudoslav
Copy link
Collaborator

This way we can produce wheels with any version number:

From workflow-dispatch with input argument 123.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

@@ -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
Copy link
Member

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?

Copy link
Collaborator Author

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?

Copy link
Member

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?

Copy link
Collaborator Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

Copy link
Collaborator Author

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

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 == ''
Copy link
Member

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?

Copy link
Collaborator Author

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.

@kounelisagis kounelisagis merged commit 8b1d7fd into dev Jul 25, 2024
33 checks passed
@kounelisagis kounelisagis deleted the db/custom_version branch July 25, 2024 14:39
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.

3 participants