You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/github_actions.md
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -56,10 +56,13 @@ Push to master and that's it.
56
56
57
57
Once the new tag is created, triggering an automatic publish command would be desired.
58
58
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.
61
60
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`.
63
66
64
67
Create a file in `.github/workflows/pythonpublish.yaml` with the following content:
65
68
@@ -87,13 +90,12 @@ jobs:
87
90
poetry install
88
91
- name: Build and publish
89
92
env:
90
-
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
93
+
PYPI_USERNAME: __token__
91
94
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
92
95
run: |
93
96
./scripts/publish
94
97
```
95
98
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)
0 commit comments