From 07e07c155f290805bae98ca4cdcd1891546ffccd Mon Sep 17 00:00:00 2001 From: Eugenio Lacuesta <1731933+elacuesta@users.noreply.github.com> Date: Wed, 21 Apr 2021 14:14:40 -0300 Subject: [PATCH] CI: publish on release event (#41) --- .github/workflows/publish.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 06ce6a2..bdfbebd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,29 +1,23 @@ name: Publish -on: [push] +on: + release: + types: [published] jobs: publish: runs-on: ubuntu-latest - if: startsWith(github.event.ref, 'refs/tags/') steps: - uses: actions/checkout@v2 - - name: Set up Python 2 + - name: Set up Python 3 uses: actions/setup-python@v2 with: - python-version: 2 - - - name: Check Tag - id: check-release-tag - run: | - if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+[.][0-9]+[.][0-9]+(rc[0-9]+|[.]dev[0-9]+)?$ ]]; then - echo ::set-output name=release_tag::true - fi + python-version: 3 - name: Publish to PyPI - if: steps.check-release-tag.outputs.release_tag == 'true' run: | + pip install --upgrade pip pip install --upgrade setuptools wheel twine python setup.py sdist bdist_wheel export TWINE_USERNAME=__token__