-
Notifications
You must be signed in to change notification settings - Fork 54
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
Allow publishing to pypi when tags are pushed #93
base: main
Are you sure you want to change the base?
Conversation
./dist/*.whl | ||
- name: Create GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
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.
PyPI?
--notes "" | ||
- name: Upload artifact signatures to GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
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.
PyPI? Did you mean
GITHUB_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
GITHUB_TOKEN: ${{ github.token }} |
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'm just using the API secret from pypi and the above is the name I gave it?
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.
@GiacomoPope the above PYPI_API_TOKEN
string is the name of the secret in the repo settings, yes. Passing it to GH CLI will make it incapable of making API calls to GH because for GH API, it's invalid. GitHub token has nothing to do with PyPI. ${{ github.token }}
contains an automatically assigned token that exists @ GHA.
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.
So do I need to add the API token elsewhere, or is having secrets.PYPI_API_TOKEN
populated enough to have gthub.token
use the right token?
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.
For example, I have this:
kyber-py/.github/workflows/ci.yml
Line 183 in 7b1c1b2
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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.
not familiar with the github actions workflows to publish to pypi so can't say one way or the other if it's correct; "passes sniff test" is the best I can do 🙂
pyproject.toml
Outdated
|
||
[project] | ||
name = "kyber-py" | ||
version = "0.1.0" |
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.
shouldn't this be "1.0.0" ?
we have https://github.com/GiacomoPope/kyber-py/releases/tag/v1.0 ...
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.
Yeah I agree
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.
Perhaps, something newer since the repo advanced since?
version = "0.1.0" | |
version = "1.0.1.dev0" |
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.
what's the meaning of the dev0 part? I would be ok with 1.0.1
publish-to-pypi: | ||
name: >- | ||
Publish Python distribution to PyPI | ||
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes |
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.
There's newer syntax available now:
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
if: github.ref_type == 'tag' # only publish to PyPI on tag pushes |
So the goal of this PR is to get the project ready so that new tags push the project to pypi too.
Maybe I need to do more for this to work, and the CI seems to be failing for something adjacent?
Edit: failure is because https://coveralls.io is down right now.