Skip to content

GitHub Actions: Upgrade to codecov v4 #127

GitHub Actions: Upgrade to codecov v4

GitHub Actions: Upgrade to codecov v4 #127

Workflow file for this run

name: Deployment
on: [push, pull_request]
jobs:
has:
name: Check Secrets
runs-on: ubuntu-latest
steps:
- id: secrets
env:
test_pypi_token: ${{ secrets.TEST_PYPI_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}
if: ${{ env.test_pypi_token != '' && env.pypi_token != '' }}
run:
echo "::set-output name=secrets::1"
outputs:
secrets: ${{ steps.secrets.outputs.secrets }}
build-and-publish:
needs: has
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: pip install build twine
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Publish distribution 📦 to Test PyPI
if: ${{ needs.has.outputs.secrets }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}