Skip to content

Add GitHub release action to upload to PyPI & create GitHub release #980

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

Merged
merged 2 commits into from
Jun 7, 2022

Conversation

terencehonles
Copy link
Contributor

@terencehonles terencehonles commented Jun 6, 2022

Creating a release action as mentioned in #959

I have tested everything except the PyPI part (commented out in terencehonles@78924b8 and terencehonles@cc1e839) by pushing the tagstest-tag-failure & test-tag-success in my fork which created the relase https://github.com/terencehonles/django-stubs/releases/tag/test-tag-success

Related issues

I can open the PR in the other repos if this looks good.

@terencehonles terencehonles mentioned this pull request Jun 6, 2022
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This secret will need to be set up in the repo or in the org (Org would be best to allow each of the stub packages to use it)

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thank you, looking cool!

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
Copy link
Member

Choose a reason for hiding this comment

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

Can you please add a comment: why __token__?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The username is just __token__ for an API token, not sure if you want to have that comment in the file.

See: https://packaging.python.org/en/latest/specifications/pypirc/#using-a-pypi-token

@terencehonles
Copy link
Contributor Author

I re-ran the changes triggering the two actions:

https://github.com/terencehonles/django-stubs/actions/runs/2449869912
https://github.com/terencehonles/django-stubs/actions/runs/2449869932 (the create issue part "worked" but failed because I don't have issues enabled on my fork)

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Awesome! I will try it tomorrow.
Thanks for working on this!

@sobolevn sobolevn merged commit 42321ca into typeddjango:master Jun 7, 2022
@intgr
Copy link
Collaborator

intgr commented Jun 7, 2022

It would be great to have something similar for djangorestframework-stubs. If the test is successful, is anyone interested in porting this over to there?

@terencehonles
Copy link
Contributor Author

It would be great to have something similar for djangorestframework-stubs. If the test is successful, is anyone interested in porting this over to there?

I can do it

I can open the PR in the other repos if this looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants