diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2022-05-30 10:57:09 +0300 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2022-05-30 10:57:09 +0300 |
commit | e5c06edaa4a012008d7c47ef02b4f91654664e23 (patch) | |
tree | 0077f9e7f3f1b3573e73e9913a32ee48f4b1a99b | |
parent | 3dde17ee6e122ab7116eb7e750ceda20ba655de1 (diff) |
Fix PyPI publish workflow
-rw-r--r-- | .github/workflows/pypi_publish.yml | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 012d1ec..de64133 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -34,15 +34,17 @@ jobs: run: | openssl sha256 nanopb/extra/poetry/dist/*.whl - - name: Run only if new changes - id: check_changes - uses: actions/cache@v1 - with: - path: nanopb/extra/poetry/build - key: check-changes-${{ github.sha }} + - name: Check for existence of PyPI package + run: | + VERSION=$(grep "^version =" nanopb/extra/poetry/build/pyproject.toml | cut -d '"' -f 2) + if curl --head --silent --fail https://pypi.org/project/nanopb/$VERSION/; then + echo "::set-env pypi_exists::true" + else + echo "::set-env pypi_exists::false" + fi - name: Publish PyPI package - if: steps.check_changes.outputs.cache-hit != 'true' + if: env.pypi_exists == 'false' env: POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_KEY }} POETRY_HTTP_BASIC_PYPI_USERNAME: __token__ |