Do not use setup.py script directly anymore #63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy sdist/wheels | |
| on: [push, pull_request] | |
| jobs: | |
| deploy: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Build sdist | |
| run: | | |
| pip install build | |
| python -m build --sdist | |
| - name: Build wheels (macOS) | |
| uses: pypa/cibuildwheel@v3.3.0 | |
| env: | |
| CIBW_PLATFORM: "macos" | |
| CIBW_ARCHS_MACOS: "universal2" | |
| CIBW_BUILD: "cp310-macosx_universal2 cp311-macosx_universal2 cp312-macosx_universal2 cp313-macosx_universal2 cp314-macosx_universal2 cp314-ios_arm64_iphoneos" | |
| CIBW_TEST_COMMAND: python -c "from pyobjus import autoclass, objc_str" | |
| with: | |
| output-dir: dist | |
| - name: Build wheels (iOS) | |
| uses: pypa/cibuildwheel@v3.3.0 | |
| env: | |
| CIBW_BEFORE_ALL: | | |
| ./.ci/build_ios_dependencies.sh | |
| CIBW_PLATFORM: "ios" | |
| CIBW_ARCHS_IOS: "arm64_iphoneos arm64_iphonesimulator x86_64_iphonesimulator" | |
| CIBW_BUILD: "cp313-* cp314-*" | |
| # Disable tests for iOS wheels for now as they require the tests to be | |
| # in the package. | |
| # CIBW_TEST_REQUIRES: "pytest" | |
| # CIBW_TEST_COMMAND: python -m pytest {project}/tests | |
| with: | |
| output-dir: dist | |
| - name: Create artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels | |
| path: dist | |
| - name: Upload to GitHub Releases | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2.4.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: dist/* | |
| - name: Publish to PyPI | |
| if: startsWith(github.ref, 'refs/tags/') | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
| run: | | |
| twine upload dist/* | |
| - name: Test sdist | |
| run: | | |
| pip uninstall cython -y | |
| root="$(pwd)" | |
| cd ~ | |
| pyobjus_fname=$(ls $root/dist/pyobjus-*.tar.gz) | |
| pip install "$pyobjus_fname" | |
| python -c "from pyobjus import autoclass, objc_str" |