This is a GitHub Action example for an auto publish PyPi package and test automation.
- Go to PyPi ➡️ Your project ➡️ Account Setting.
- Create an API token.
- Note: If you just first time create the token, need to select all project at Scope.
- You would find username and password.
- Setup PYPI_USERNAME and PYPI_PASSWORD in GitHub
Setting
➡️Secrets
. - Click New repository secret and add two property.
-
Modify
GitHub_Action_Python_Example/__version__.py
version number(e.g. 1.0.2). -
Click and draft
Release
note.
.github/workflows/publish.yml
will help you to publish package to PyPi.
pip install GitHub-Action-Python-Example
from GitHub_Action_Python_Example.client import HelloWorld
message = HelloWorld(message="Change the World~")
print(message.get_message())