[test] release 0.3.14.post39 #90
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: Test Publish to TestPyPI 🧪 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| paths: | |
| - 'pytron/**' | |
| - 'tests/**' | |
| - 'pyproject.toml' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-wheels: | |
| name: 🏗️ Build Wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # ubuntu-22.04 = glibc 2.35, which matches our manylinux_2_35 target tag. | |
| # ubuntu-latest is now 24.04 (glibc 2.39) and auditwheel will refuse to retag | |
| # a 2.39-compiled wheel as manylinux_2_35. | |
| os: [ubuntu-22.04, macos-latest, windows-latest] | |
| python-version: ["3.11"] | |
| steps: | |
| - name: 🔍 Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: 🐍 Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| cache-dependency-path: 'pyproject.toml' | |
| - name: 🛠️ Install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build wheel setuptools | |
| # startsWith handles both ubuntu-latest and ubuntu-22.04 safely | |
| - name: 🐧 Install Linux System Dependencies | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libcairo2-dev \ | |
| libgirepository1.0-dev \ | |
| libglib2.0-dev \ | |
| pkg-config \ | |
| python3-dev \ | |
| libwebkit2gtk-4.1-dev \ | |
| libgtk-3-dev \ | |
| libayatana-appindicator3-dev \ | |
| libxdo-dev \ | |
| libssl-dev \ | |
| libwayland-dev \ | |
| libxkbcommon-dev \ | |
| libx11-dev \ | |
| patchelf | |
| - name: 🍎 Install macOS Dependencies | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| python -m pip install pyobjc-framework-Quartz pyobjc-framework-Cocoa | |
| - name: 🦀 Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: 🕰️ Setup Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: ${{ matrix.os }} | |
| workspaces: | | |
| pytron/engines/native | |
| pytron/pack/secure_loader | |
| - name: 🛡️ Build Rust Loader | |
| run: python pytron/pack/secure_loader/build_loader.py || echo "Skipping loader build" | |
| - name: 🦾 Build Native Engine | |
| env: | |
| PYO3_PYTHON: python3 | |
| run: python pytron/engines/native/build.py | |
| - name: 🧪 Run Tests | |
| run: | | |
| python -m pip install . | |
| python -m pip install pytest pytest-asyncio | |
| pytest | |
| - name: 📦 Build Wheel | |
| run: python -m build --wheel | |
| - name: 🏷️ Retag Linux Wheel (Experimental) | |
| if: startsWith(matrix.os, 'ubuntu') | |
| shell: bash | |
| run: | | |
| for whl in dist/*.whl; do | |
| new_whl=$(echo "$whl" | sed 's/linux_x86_64/manylinux_2_35_x86_64/g') | |
| mv "$whl" "$new_whl" | |
| done | |
| # Linux note: | |
| # Do not run auditwheel here. Repairing the wheel vendors GTK/WebKit and | |
| # related GLib stack libraries into pytron_kit.libs, which then mix with | |
| # host loader/modules (pixbuf loaders, gio modules, etc.) and crash native | |
| # startup with duplicate GType registration. | |
| - name: 📤 Upload Wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.os }}-${{ matrix.python-version }} | |
| path: dist/*.whl | |
| build-sdist: | |
| name: 📄 Build SDist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 🔍 Checkout code | |
| uses: actions/checkout@v4 | |
| - name: 🐍 Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: 📦 Build SDist | |
| run: | | |
| pip install build | |
| python -m build --sdist | |
| - name: 📤 Upload SDist | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| publish-test: | |
| name: 🚀 Publish to TestPyPI | |
| runs-on: ubuntu-latest | |
| needs: [build-wheels, build-sdist] | |
| permissions: | |
| id-token: write | |
| environment: testpypi | |
| steps: | |
| - name: 📥 Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: '*' | |
| path: dist | |
| merge-multiple: true | |
| - name: 📦 Prepare TestPyPI Upload Set | |
| shell: bash | |
| run: | | |
| mkdir -p pypi-dist | |
| cp dist/*.whl pypi-dist/ 2>/dev/null || true | |
| cp dist/*.tar.gz pypi-dist/ 2>/dev/null || true | |
| echo "TestPyPI upload set:" | |
| ls -1 pypi-dist | |
| - name: 🐍 Publish to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| packages-dir: pypi-dist | |
| skip-existing: true | |
| # Attestations are a production PyPI security feature — TestPyPI doesn't | |
| # require them and re-uploading the same attestation causes a generic | |
| # 400 Bad Request that skip-existing can't catch (it only handles 409s). | |
| attestations: false | |
| # Always show verbose output so 400s show the actual rejection reason. | |
| verbose: true |