From e0f2a91d04128b0d36d0392bc7f3efec80d69332 Mon Sep 17 00:00:00 2001 From: jenisys Date: Sat, 31 Aug 2024 08:55:09 +0200 Subject: [PATCH] CI: release-to-pypi workflow * Add guard to use only for versionized tags/releases --- .envrc | 1 + .github/workflows/release-to-pypi.yml | 7 ++++--- bin/github-workflow_check.py | 1 + py.requirements/develop.txt | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.envrc b/.envrc index dd4913c..907df61 100644 --- a/.envrc +++ b/.envrc @@ -23,5 +23,6 @@ source_env_if_exists .envrc.use_venv # -- SETUP-PYTHON: Prepend ${HERE} to PYTHONPATH (as PRIMARY search path) # SIMILAR TO: export PYTHONPATH="${HERE}:${PYTHONPATH}" path_add PYTHONPATH . +path_add PATH bin # DISABLED: source_env_if_exists .envrc.override diff --git a/.github/workflows/release-to-pypi.yml b/.github/workflows/release-to-pypi.yml index 0d5f01b..66608f2 100644 --- a/.github/workflows/release-to-pypi.yml +++ b/.github/workflows/release-to-pypi.yml @@ -19,15 +19,16 @@ name: release-to-pypi on: release: types: [published] - # MAYBE: if: github.event_name == "push" && startsWith(github.ref, "refs/tags/v") - + tags: + - v0.* + - v1.* permissions: contents: read jobs: publish-package: runs-on: ubuntu-latest - # MAYBE: if: github.event_name == "push" && startsWith(github.ref, "refs/tags/v") + if: ${{ startsWith(github.ref, 'refs/tags/v') }} environment: name: pypi url: https://pypi.org/p/parse-type diff --git a/bin/github-workflow_check.py b/bin/github-workflow_check.py index f641df2..c586fff 100755 --- a/bin/github-workflow_check.py +++ b/bin/github-workflow_check.py @@ -22,6 +22,7 @@ * pip install check-jsonschema * pip install typer >= 0.12.5 +* pip install typing-extensions GITHUB WORKFLOW SCHEMA: diff --git a/py.requirements/develop.txt b/py.requirements/develop.txt index 974a186..d1bc1fb 100644 --- a/py.requirements/develop.txt +++ b/py.requirements/develop.txt @@ -16,6 +16,10 @@ wheel # -- PYTHON2/PYTHON3 COMPATIBILITY: modernize >= 0.5 +# -- PYTHON 3 TYPE HINTS: +typing-extensions; python_version >= '3.8' +typer >= 0.12.5; python_version >= '3.7' + # -- LINTERS: ruff; python_version >= '3.7' pylint