This repository is a template for publishing Python packages to PyPI and TestPyPI using GitHub Actions and shell scripts.
-
Clone the repository:
git clone https://github.com/yourusername/pypi-publisher-template.git cd pypi-publisher-template
-
Run the setup script:
chmod +x setup.sh ./setup.sh
-
Update your .env file with your PyPI and TestPyPI tokens:
TEST_PYPI_API_TOKEN=your_test_pypi_token_here PYPI_API_TOKEN=your_pypi_token_here BASE_URL=your_base_url_here
Run the following command to publish to TestPyPI:
chmod +x publish_test.sh
./publish_test.sh
Run the following command to publish to PyPI:
chmod +x publish_pypi.sh
./publish_pypi.sh
The GitHub Actions workflow is configured to publish to PyPI on tag creation and push to the main branch. Make sure to configure your repository secrets with the required tokens.
This project is licensed under the MIT License.