From 75d060c7cf9a2a035c53261c6423028b046cddc6 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 9 Sep 2021 13:37:57 -0700 Subject: [PATCH] fix action on release tag --- .github/workflows/build-publish.yml | 12 +++--------- .github/workflows/win-build-publish.yml | 10 ++-------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 2fa55e5..f15c12b 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -37,23 +37,17 @@ jobs: name: pygeoda-${{ matrix.os }} path: wheelhouse/ - - name: Check Release Tag - id: check-tag - run: | - if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo ::set-output name=publish::true - fi - - name: Publish to Pypi - if: steps.check-tag.outputs.publish == 'true' + if: startsWith(github.ref, 'refs/tags/v') env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | + python3 -m pip install --upgrade twine python3 -m twine upload wheelhouse/*.whl - name: Publish Source to Pypi - if: matrix.os == 'macos-latest' && steps.check-tag.outputs.publish == 'true' + if: matrix.os == 'macos-latest' && startsWith(github.ref, 'refs/tags/v') env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} diff --git a/.github/workflows/win-build-publish.yml b/.github/workflows/win-build-publish.yml index 083e442..3a82008 100644 --- a/.github/workflows/win-build-publish.yml +++ b/.github/workflows/win-build-publish.yml @@ -77,17 +77,11 @@ jobs: name: pygeoda-${{ matrix.python_ver }}-${{ matrix.msvc_arch }}-win path: wheelhouse/ - - name: Check Release Tag - id: check-tag - run: | - if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo ::set-output name=publish::true - fi - - name: Publish to Pypi - if: steps.check-tag.outputs.publish == 'true' + if: startsWith(github.ref, 'refs/tags/v') env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | + python -m pip install --upgrade twine python -m twine upload wheelhouse/*.whl