From 0cfe81d1d3978169f6c8ccc90e49315dcd67aca7 Mon Sep 17 00:00:00 2001 From: Laerte Pereira <5853172+Laerte@users.noreply.github.com> Date: Sat, 21 Jan 2023 16:57:31 -0300 Subject: [PATCH 1/3] `set-output` command is deprecated --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index eee9a4f02..02cf0c9fa 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,7 +18,7 @@ jobs: 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 + echo "release_tag=true" >> $GITHUB_OUTPUT fi - name: Publish to PyPI From 12559ed21e7b89837af895f8aef8d56c5425bf30 Mon Sep 17 00:00:00 2001 From: Laerte Pereira Date: Thu, 2 Feb 2023 08:59:35 -0300 Subject: [PATCH 2/3] refactor: Publish workflow --- .github/workflows/publish.yml | 40 +++++++++++++---------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 02cf0c9fa..bf368cc2f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,31 +1,21 @@ name: Publish -on: [push] +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' jobs: publish: runs-on: ubuntu-latest - if: startsWith(github.event.ref, 'refs/tags/') - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - - 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 "release_tag=true" >> $GITHUB_OUTPUT - fi - - - name: Publish to PyPI - if: steps.check-release-tag.outputs.release_tag == 'true' - run: | - pip install --upgrade build twine - python -m build - export TWINE_USERNAME=__token__ - export TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }} - twine upload dist/* + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.11 + - run: | + pip install --upgrade build twine + python -m build + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1.6.4 + with: + password: ${{ secrets.PYPI_TOKEN }} From 4a424adfff17df785bd843e67a0d552b2e05671f Mon Sep 17 00:00:00 2001 From: Laerte Pereira Date: Thu, 2 Feb 2023 09:21:53 -0300 Subject: [PATCH 3/3] fix: action version --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bf368cc2f..22b8996b6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,6 +16,6 @@ jobs: pip install --upgrade build twine python -m build - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1.6.4 + uses: pypa/gh-action-pypi-publish@v1.6.4 with: password: ${{ secrets.PYPI_TOKEN }}