PYPI Publish #168
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: PYPI Publish | |
on: | |
workflow_run: | |
# Depend on the CI workflow | |
workflows: ["CI"] | |
pull_request: | |
push: | |
branches: | |
- "master" | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
pypi-publish: | |
name: Upload release to PyPI | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/pytest-odoo | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
if: startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
- name: Install pypa/build | |
run: python -m pip install build | |
- name: Build a binary wheel and a source tarball | |
run: python -m build --sdist --wheel --outdir dist/ | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |