Skip to content

Commit

Permalink
build for both python and linux
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Oct 31, 2024
1 parent cd75725 commit 3a48f78
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 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]
timeout-minutes: 10
name: Build and publish Python package
runs-on: ubuntu-latest
name: Build and publish Python package (${{ matrix.os }})
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
Expand All @@ -28,20 +31,43 @@ jobs:
with:
python-version: "3.10"

- name: Install system dependencies
run: |
sudo apt-get update
- 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 maturin build wheel
- name: Build package
run: python -m build --sdist --wheel --outdir dist/ .
run: maturin build --release --strip --out dist

- name: Upload wheel artifacts
uses: actions/upload-artifact@v3
with:
name: wheels-${{ matrix.os }}
path: dist/*.whl

publish-wheels:
needs: publish-python
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
Expand Down

0 comments on commit 3a48f78

Please sign in to comment.