Bump codecov/codecov-action from 3 to 5 in the github-actions group #137
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: 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 }} |