Skip to content

Deploy to TestPyPI 📦 #31

Deploy to TestPyPI 📦

Deploy to TestPyPI 📦 #31

name: Deploy to TestPyPI 📦
# trigger deploy workflow once build and test workflow has successfully completed
on:
workflow_run:
workflows: ["Building and Testing"]
types:
- completed
# allow for workflow to be manually initiated from the Actions tab
workflow_dispatch:
#build and deploy to Test PyPI server
jobs:
build:
name: Deploy to TestPyPI 📦
runs-on: ubuntu-latest # platform: [ubuntu-latest, macos-latest, windows-latest]
strategy:
matrix:
python-version: [3.9] #deploying using one Python version on 1 runner
steps:
- uses: actions/checkout@v3
# build distribution package using poetry tool and upload to the test PYPi server via custom github action
- name: Build and publish to Test PyPI
uses: JRubics/poetry-publish@v2.0
with:
pypi_token: ${{ secrets.PYPI_TEST }}
repository_name: "testpypi"
repository_url: "https://test.pypi.org/legacy/"
#sleep for 30 seconds to ensure that distribution package has finished uploading to Test PyPI
- name: Wait / Sleep
uses: jakejarvis/wait-action@master
with:
time: '30s'
# download package of iso3166_2 from Test PYPI server to ensure it uploaded correctly
- name: Install iso3166_2 from Test PyPI
run: |
pip install -i https://test.pypi.org/simple/ iso3166_2 --upgrade
echo "iso3166_2 successfully installed"