wip: V3.0.0 #274
Workflow file for this run
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: Python - Build packages & Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| release: | |
| types: [created] | |
| jobs: | |
| # ============================ | |
| # BUILD (multi-architecture) | |
| # ============================ | |
| build-python-packages: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [x86_64, arm64] | |
| runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Python stubs | |
| run: cargo run --bin stub_gen | |
| - name: Install Python build dependencies | |
| run: pip install maturin==1.8.2 | |
| - name: Build Python packages | |
| run: maturin build --sdist --release -m pyadb_client/Cargo.toml | |
| - name: Upload wheels as artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.arch }} | |
| path: target/wheels/* | |
| if-no-files-found: error | |
| # ================================ | |
| # PUBLISH (release creation only) | |
| # ================================ | |
| publish: | |
| name: Publish to PyPI & GitHub Release | |
| if: github.event_name == 'release' && github.event.action == 'created' | |
| needs: build-python-packages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download wheels for x86_64 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: wheels-x86_64 | |
| path: wheels/x86_64 | |
| - name: Download wheels for arm64 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: wheels-arm64 | |
| path: wheels/arm64 | |
| - name: Publish Python packages to PyPI | |
| run: maturin publish wheels/**/*.whl --non-interactive | |
| env: | |
| MATURIN_PYPI_TOKEN: ${{ secrets.MATURIN_PYPI_TOKEN }} | |
| - name: Publish GitHub release artifacts | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: wheels/**/*.* |