diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 25cfaf8c..019b986f 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -2,7 +2,6 @@ name: Wheels on: [ push, pull_request ] - jobs: build_wheels: name: Build wheels on ${{ matrix.os }} @@ -76,61 +75,61 @@ jobs: wheelhouse/*.whl build-sdist-and-upload: - runs-on: ubuntu-latest - needs: ['build_wheels'] - environment: wheels - permissions: - id-token: write - - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.10" - cache: pip - cache-dependency-path: "setup.py" - - - name: Install dependencies - run: | - python -m pip install -U pip - python -m pip install -U build twine - - - name: Download wheels from build artifacts - uses: actions/download-artifact@v4 - with: - pattern: wheels-* - merge-multiple: true - path: dist-wheels/ - - - name: Build package - run: | - python -m build --sdist - twine check --strict dist/* - twine check --strict dist-wheels/* - - - name: Publish wheels to PyPI Test - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - packages-dir: dist-wheels/ - - - name: Publish sdist to PyPI Test - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - - - name: Publish wheels to PyPI - if: ${{ startsWith(github.ref, 'refs/tags/') }} - uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: dist-wheels/ - - - name: Publish sdist to PyPI - if: ${{ startsWith(github.ref, 'refs/tags/') }} - uses: pypa/gh-action-pypi-publish@release/v1 + runs-on: ubuntu-latest + needs: [ 'build_wheels' ] + environment: wheels + permissions: + id-token: write + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + cache: pip + cache-dependency-path: "setup.py" + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -U build twine + + - name: Download wheels from build artifacts + uses: actions/download-artifact@v4 + with: + pattern: wheels-* + merge-multiple: true + path: dist-wheels/ + + - name: Build package + run: | + python -m build --sdist + twine check --strict dist/* + twine check --strict dist-wheels/* + + - name: Publish wheels to PyPI Test + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + packages-dir: dist-wheels/ + + - name: Publish sdist to PyPI Test + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + + - name: Publish wheels to PyPI + if: ${{ startsWith(github.ref, 'refs/tags/') }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist-wheels/ + + - name: Publish sdist to PyPI + if: ${{ startsWith(github.ref, 'refs/tags/') }} + uses: pypa/gh-action-pypi-publish@release/v1