Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 8 additions & 38 deletions .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
types: [created]

jobs:
# ============================
# BUILD (multi-architecture)
# ============================
build-python-packages:
strategy:
fail-fast: false
Expand All @@ -27,50 +24,23 @@ jobs:
run: cargo run --bin stub_gen

- name: Install Python build dependencies
run: pip install maturin==1.8.2
run: pip install maturin==1.10.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: Install maturin
run: pip install maturin==1.8.2

- name: Download wheels for x86_64
uses: actions/download-artifact@v4
with:
name: wheels-x86_64
path: dist/x86_64

- name: Download wheels for arm64
uses: actions/download-artifact@v4
with:
name: wheels-arm64
path: dist/arm64

# ==========================
# PUBLISH (release only)
# ==========================
- name: Publish Python packages to PyPI
run: maturin publish dist/**/*.whl --non-interactive
if: github.event_name == 'release' && github.event.action == 'created'
run: maturin publish --skip-existing --non-interactive -m pyadb_client/Cargo.toml
env:
MATURIN_PYPI_TOKEN: ${{ secrets.MATURIN_PYPI_TOKEN }}

- name: Publish GitHub release artifacts
if: github.event_name == 'release' && github.event.action == 'created'
uses: softprops/action-gh-release@v2
with:
files: |
dist/**/*.whl
target/wheels/*.whl
Loading