diff --git a/.github/workflows/publish-to-pypi.yaml b/.github/workflows/publish-to-pypi.yaml index 4219533f..93daeaa7 100644 --- a/.github/workflows/publish-to-pypi.yaml +++ b/.github/workflows/publish-to-pypi.yaml @@ -6,88 +6,27 @@ on: - v* jobs: - # First job is to build the wheels on different OS - build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.12" - - - name: Upgrade pip and install cibuildwheel - run: | - python -m pip install --upgrade pip - pip install cibuildwheel - - - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse - env: - CIBW_BUILD: "cp310-* cp311-* cp312-*" - CIBW_SKIP: "pp* *musllinux*" - CIBW_TEST_SKIP: "*" - CIBW_ARCHS_MACOS: "universal2" - CIBW_ARCHS_LINUX: "x86_64 aarch64" - - - name: Upload built wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-${{ matrix.os }} - path: wheelhouse/*.whl - - # Then just build the source distribution as normal - build_sdist: - name: Build source distribution + build-release: + name: Build and publish PyPI runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - + with: + fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v3 with: - python-version: "3.12" + python-version: '3.10' - - name: Upgrade pip and install build + - name: Install build tools run: | - python -m pip install --upgrade pip - pip install build - - - name: Build sdist - run: python -m build --sdist --outdir dist - - - name: Upload sdist - uses: actions/upload-artifact@v4 - with: - name: sdist - path: dist/*.tar.gz - - # Finally publish all files to PyPI - publish: - name: Publish to PyPI - needs: [build_wheels, build_sdist] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - path: dist + pip install --upgrade pip setuptools wheel build setuptools_scm - - name: Merge all distributions + - name: Build Package run: | - mkdir -p final_dist - find dist -name '*.whl' -exec cp {} final_dist/ \; - find dist -name '*.tar.gz' -exec cp {} final_dist/ \; + python -m build --no-isolation - - name: Publish to PyPI + - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.PYPI_API_TOKEN }} - packages_dir: final_dist + password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file