Skip to content

Publish Python package to Test PyPI - Joule #3

Publish Python package to Test PyPI - Joule

Publish Python package to Test PyPI - Joule #3

name: Publish Python package to Test PyPI - Joule
on:
workflow_dispatch:
jobs:
build-and-publish:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install build and twine
run: |
python -m pip install --upgrade pip
pip install setuptools build twine
- name: Install package dependencies
run: |
pip install -e .[full]
- name: Run tests
run: |
python3 -m unittest discover -s tests -v
- name: Build package
run: |
python -m build
- name: Check package with twine
run: |
twine check dist/*
- name: Publish to Test PyPI
if: success()
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.JOULE_TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/