From 90cbb9a09dd1bf28f78a04933727d3229c9b6ad9 Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Thu, 31 Oct 2024 23:38:48 -0700 Subject: [PATCH] update publish flow --- .github/workflows/publish.yml | 56 +++++++++++++++++++++++++++++------ Cargo.toml | 2 +- 2 files changed, 48 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5568282..51c8122 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,9 +15,12 @@ concurrency: jobs: publish-python: + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + name: Build and publish Python package (${{ matrix.os }}) timeout-minutes: 10 - name: Build and publish Python package - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} steps: - name: Checkout code @@ -28,25 +31,60 @@ jobs: with: python-version: "3.10" - - name: Install system dependencies - run: | - sudo apt-get update - sudo apt-get install -y libudev-dev pkg-config + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable - name: Install dependencies run: | python -m pip install --upgrade pip - pip install build wheel + pip install cibuildwheel + shell: bash - name: Build package - run: python -m build --sdist --outdir dist/ . + env: + CIBW_SKIP: "pp* *-musllinux*" # Skip PyPy and musllinux builds + CIBW_BEFORE_BUILD: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + source $HOME/.cargo/env + pip install setuptools-rust + CIBW_ENVIRONMENT: | + PATH="/usr/local/bin:$HOME/.cargo/bin:$PATH" + CARGO_NET_GIT_FETCH_WITH_CLI=true + run: cibuildwheel --output-dir dist + + - name: Upload wheel artifacts + uses: actions/upload-artifact@v3 + with: + name: wheels-${{ matrix.os }} + path: dist/*.whl + + publish-wheels: + needs: publish-python + name: Publish Python wheels + timeout-minutes: 10 + runs-on: ubuntu-latest + + steps: + - name: Download all wheels + uses: actions/download-artifact@v3 + with: + path: dist + + - name: Move wheels to dist directory + run: | + mkdir -p final_dist + find dist -name "*.whl" -exec mv {} final_dist/ \; - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: final_dist/ publish-rust: - timeout-minutes: 10 name: Build and publish Rust package + timeout-minutes: 10 runs-on: ubuntu-latest steps: diff --git a/Cargo.toml b/Cargo.toml index 9775aaa..723a195 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ resolver = "2" [workspace.package] -version = "0.1.2" +version = "0.1.3" authors = ["Wesley Maa ", "Pawel Budzianowski ", "Benjamin Bolte "] edition = "2021" description = "Actuator package"