Hitl testing dev #34
Workflow file for this run
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 Python 🐍 distributions 📦 to PyPI and TestPyPI | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
types: | |
- closed | |
jobs: | |
build-n-publish: | |
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI | |
runs-on: ubuntu-latest | |
environment: | |
name: release | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
pip install -e . | |
- name: Test with pytest | |
run: | | |
pytest | |
- name: Install pypa/build | |
run: >- | |
pip install build --user | |
- name: Build a source tarball and a binary wheel | |
run: >- | |
python3 -m build --sdist --wheel --outdir dist/ . | |
- name: Publish distribution 📦 to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
skip-existing: true | |
- name: Publish distribution 📦 to PyPI | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: pypa/gh-action-pypi-publish@release/v1 |