diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6d93d3..daa7e09 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -146,9 +146,6 @@ jobs: - build_sdist_python_wheel runs-on: ubuntu-latest if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - environment: - name: PyPI - url: https://pypi.org/project/mypy-dev/ permissions: contents: write # Required to upload release assets steps: @@ -158,13 +155,6 @@ jobs: pattern: dist-* path: dist merge-multiple: true - - uses: actions/setup-python@v5 - name: Install Python - with: - python-version: "3.11" - - name: Install twine - run: | - pip install twine - name: Release uses: actions/github-script@v7 with: @@ -202,6 +192,29 @@ jobs: data: await fs.readFile(`./dist/${file}`) }); } + + upload: + name: Upload release to PyPI + needs: + - release + runs-on: ubuntu-latest + environment: + name: PyPI + url: https://pypi.org/project/mypy-dev/ + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + pattern: dist-* + path: dist + merge-multiple: true + - uses: actions/setup-python@v5 + name: Install Python + with: + python-version: "3.11" + - name: Install twine + run: | + pip install twine - name: Upload to PyPI env: TWINE_REPOSITORY: pypi