Skip to content

Commit

Permalink
update publish flow
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Nov 1, 2024
1 parent 3c292dd commit 90cbb9a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 10 deletions.
56 changes: 47 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resolver = "2"

[workspace.package]

version = "0.1.2"
version = "0.1.3"
authors = ["Wesley Maa <[email protected]>", "Pawel Budzianowski <[email protected]>", "Benjamin Bolte <[email protected]>"]
edition = "2021"
description = "Actuator package"
Expand Down

0 comments on commit 90cbb9a

Please sign in to comment.