Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 985f391

Browse files
authored
Merge pull request #162 from commitizen-tools/weilee/update-publish-doc
docs(tutorial/github_actions): suggest using pypi api token
2 parents c8bd2f0 + de6a25e commit 985f391

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

‎docs/tutorials/github_actions.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ Push to master and that's it.
5656
5757
Once the new tag is created, triggering an automatic publish command would be desired.
5858
59-
In order to do so, the first two secrets need to be added with the information
60-
of our pypi account.
59+
In order to do so, the crendetial needs to be added with the information of our PyPI account.
6160
62-
Go to `Settings > Secrets > Add new secret` and add the secrets: `PYPI_USERNAME` and `PYPI_PASSWORD`.
61+
Instead of using username and password, we suggest using [api token](https://pypi.org/help/#apitoken) generated from PyPI.
62+
63+
After generate api token, use the token as the PyPI password and `__token__` as the username.
64+
65+
Go to `Settings > Secrets > Add new secret` and add the secret: `PYPI_PASSWORD`.
6366

6467
Create a file in `.github/workflows/pythonpublish.yaml` with the following content:
6568

@@ -87,13 +90,12 @@ jobs:
8790
poetry install
8891
- name: Build and publish
8992
env:
90-
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
93+
PYPI_USERNAME: __token__
9194
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
9295
run: |
9396
./scripts/publish
9497
```
9598

96-
Notice that we are calling a bash script in `./scripts/publish`, you should
97-
configure it with your tools (twine, poetry, etc.). Check [commitizen example](https://github.com/commitizen-tools/commitizen/blob/master/scripts/publish)
99+
Notice that we are calling a bash script in `./scripts/publish`, you should configure it with your tools (twine, poetry, etc.). Check [commitizen example](https://github.com/commitizen-tools/commitizen/blob/master/scripts/publish)
98100

99101
Push the changes and that's it.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /