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

Validate GitHub release on publish #325

Closed
wants to merge 2 commits into from

Conversation

agners
Copy link
Collaborator

@agners agners commented Jun 22, 2023

Make sure the tag created by the GitHub release matches the Python project metadata.

This is in preparation for Docker image build, which will rely on the release tag to fetch the latest Matter Server from PyPI.

Comment on lines +23 to +29
- name: Validate tag matches Python project version
shell: python
run: |-
import tomli
with open("pyproject.toml", "rb") as f:
pyproject = tomli.load(f)
assert pyproject["project"]["version"] == "${{ steps.vars.outputs.tag }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively (and IMHO better solution), is to not set it and update it on release automatically.

Copy link
Collaborator Author

@agners agners Jun 22, 2023

Choose a reason for hiding this comment

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

Hm, so that would involve reading pyproject.toml here, setting the version and writing it back out? Or is there a better way to do this? It seems that Python build doesn't like a pyproject.toml without the version in the project section.

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've implemented that in a new PR, see #326.

@agners agners closed this Jun 22, 2023
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.

2 participants