Publish to TestPyPI #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to TestPyPI | |
on: | |
workflow_run: | |
workflows: ["Unit Tests"] # The name of your tests workflow | |
types: | |
- completed # Trigger when the tests workflow completes | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} # Only run if tests passed | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' # Specify the Python version you want to use | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel twine | |
- name: Build the package | |
run: python setup.py sdist bdist_wheel | |
- name: Publish to TestPyPI | |
env: | |
TWINE_USERNAME: __token__ # Use the username __token__ | |
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} | |
run: twine upload --repository testpypi dist/* |