Skip to content

Commit

Permalink
ci: build python wheels (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
cocool97 authored Jan 24, 2025
1 parent 775b242 commit 39591b6
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 44 deletions.
53 changes: 41 additions & 12 deletions .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,49 @@
name: Python - Build
name: Python - Build packages & Release

on: [push, pull_request]

env:
CARGO_TERM_COLOR: always
on:
push: {}
pull_request: {}
release:
types: [created]

jobs:
build-release-python:
name: "build-release-python"
build-python-packages:
runs-on: ubuntu-latest
defaults:
run:
working-directory: pyadb_client

steps:
- uses: actions/checkout@v4

- name: Install Python dependencies
run: pip install .

- name: Build Python packages
run: maturin build --release --interpreter "3.8" --interpreter "3.9" --interpreter "3.10" --interpreter "3.11" --interpreter "3.12" --interpreter "3.13"

publish-python-packages:
runs-on: ubuntu-latest
defaults:
run:
working-directory: pyadb_client
needs: [build-python-packages]
if: github.event_name == 'release' && github.event.action == 'created'

steps:
- uses: actions/checkout@v4
- name: Install Python dependencies
run: pip install .
- name: Build project
run: maturin build --release
- uses: actions/checkout@v4

- name: Install Python dependencies
run: pip install .

- name: Publish Python packages
run: maturin publish --no-interactive
env:
MATURIN_PYPI_TOKEN: ${{ secrets.MATURIN_PYPI_TOKEN }}

- name: "Publish GitHub artefacts"
uses: softprops/action-gh-release@v2
with:
files: |
target/wheels/pyadb_client*.whl
target/wheels/pyadb_client*.tar.gz
30 changes: 0 additions & 30 deletions .github/workflows/python-release.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage = "https://github.com/cocool97/adb_client"
keywords = ["adb", "android", "tcp", "usb"]
license = "MIT"
repository = "https://github.com/cocool97/adb_client"
version = "2.1.2"
version = "2.1.3"

# To build locally when working on a new release
[patch.crates-io]
Expand Down
2 changes: 1 addition & 1 deletion pyadb_client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ requires = ["maturin>=1,<2"]
build-backend = "maturin"

[project]
dependencies = ["maturin", "patchelf"]
name = "pyadb_client"
dependencies = ["maturin", "patchelf"]
dynamic = ["version"] # Let the build system automatically set package version
classifiers = [
"Programming Language :: Rust",
Expand Down

0 comments on commit 39591b6

Please sign in to comment.