diff --git a/.github/workflows/protobuf.yml b/.github/workflows/protobuf.yml index 0a6401455..0e15a3ed3 100644 --- a/.github/workflows/protobuf.yml +++ b/.github/workflows/protobuf.yml @@ -131,7 +131,7 @@ jobs: if-no-files-found: error - name: Upload Python Distribution - if: ${{ github.event_name == 'pull_request' || ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) }} + if: ${{ github.event_name == 'pull_request' || ( github.event_name == 'push' && ( github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') ) ) }} uses: actions/upload-artifact@v4 with: name: python-dist @@ -235,7 +235,7 @@ jobs: needs: [build-proto2-linux64, build-proto3-linux64] - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + if: ${{ github.event_name == 'push' && ( github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') ) }} steps: - name: Download Distribution @@ -248,3 +248,7 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ + + - name: Publish Full Release on PyPI + if: startsWith(github.ref, 'refs/tags/v') + uses: pypa/gh-action-pypi-publish@release/v1