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

feat: Automatic PyPI Publishing using Tags and add Auto Releasing #148

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

PCain02
Copy link
Collaborator

@PCain02 PCain02 commented Oct 28, 2024

Automatic PyPI Publishing using Tags and add Auto Releasing

Description

YOU SHOULD TEST THIS IN YOUR OWN FORK

This PR adds the ability to publish to PyPI automatically when using tags. tag_publish.yml and test-publish.yml were the main targets of the PR. The lowercase t tag will be used for test publishing and the lowercase v tag is for real publishing. They should look like t0.7.1 and v0.7.1

The commands to use this are as follows where the version number is replaced with the next sequential version.

poetry version 0.3.1
git add pyproject.toml
git commit -m "Chore: Bump version to 0.3.1"
git tag t0.3.1
git push origin t0.3.1

You will know it worked if Test PyPI has updated the version number

Note: Do not use the v tag to test the PR because that will cause a new release which is not ideal.

At the same time you should see the release number go up. This is why you should do it in your own fork.
image

Linked Issues

Closes: #137

Type of Change

  • Feature
  • Bug fix
  • Documentation

Contributors

@PCain02 PCain02 added the enhancement New feature or request label Oct 28, 2024
@PCain02 PCain02 self-assigned this Oct 31, 2024
@CalebKendra
Copy link
Collaborator

This PR needs a secret key to work in the publish.yml file.

I lack experience in Pypi and needed to approve this. Potentially another TL could help?

@rebekahrudd
Copy link
Collaborator

Should we test this in your fork?

I ran into issues because I was in your fork but then I couldn't push to your fork to test it. Here's my output:
pallas_tag feature

Copy link
Collaborator

@rebekahrudd rebekahrudd left a comment

Choose a reason for hiding this comment

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

This worked on Linux:
pypi

@AlishChhetri AlishChhetri self-requested a review November 7, 2024 20:18
@AlishChhetri
Copy link
Collaborator

@PCain02, please confirm that this feature works on macOS. I see you’ve tested it on Windows, and Rebekah confirmed it on Linux. We just need a macOS test to complete the cross-platform verification. The feature looks great, and I don’t see any issues with the implementation.

One question for clarification: does any instance of a v tag trigger a release to PyPI, or only when that tag is committed to the main branch? For instance, if someone on a feature branch uses a v tag, would it publish to PyPI without being merged into main?

Thank you for clarifying, and I apologize if it’s a basic question!

@gkapfham
Copy link
Collaborator

Hello @PCain02 can you seek out confirmation that this works if the person who performs the release is running MacOS, as @AlishChhetri has suggested?

@PCain02
Copy link
Collaborator Author

PCain02 commented Nov 21, 2024

@PCain02, please confirm that this feature works on macOS. I see you’ve tested it on Windows, and Rebekah confirmed it on Linux. We just need a macOS test to complete the cross-platform verification. The feature looks great, and I don’t see any issues with the implementation.

One question for clarification: does any instance of a v tag trigger a release to PyPI, or only when that tag is committed to the main branch? For instance, if someone on a feature branch uses a v tag, would it publish to PyPI without being merged into main?

Thank you for clarifying, and I apologize if it’s a basic question!

This is a super interesting question and I did not even think of that. I just tested it and yes it does seem you can tag in any branch and publish it to PyPI. I never even considered this as an issue but would it be better if there was some sort of check that the person is in the main branch before publishing? Thanks for bringing this to my attention!

@PCain02
Copy link
Collaborator Author

PCain02 commented Nov 21, 2024

Hello @PCain02 can you seek out confirmation that this works if the person who performs the release is running MacOS, as @AlishChhetri has suggested?

Yes! I added @Chezka109 @hemanialaparthi and @dyga01 all MacOS users very good at testing. If they would be so kind I would appreciate the testing!

@PCain02 PCain02 changed the title feat: Automatic PyPI Publishing using Tags feat: Automatic PyPI Publishing using Tags and add Auto Releasing Nov 21, 2024
Copy link
Collaborator

@rebekahrudd rebekahrudd left a comment

Choose a reason for hiding this comment

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

It worked on Linux

Tagging the new version:
Screenshot from 2024-11-22 22-22-24

Updating on pypi:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic Release to PyPI Not Triggered
5 participants