Skip to content

Artifact unique names +++++++++++ #23

Artifact unique names +++++++++++

Artifact unique names +++++++++++ #23

Workflow file for this run

name: Build and publish wheels
on:
push:
tags:
- "v*.*.*" # Only run on version tags like v0.1.0
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11'] # Supported Python versions
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install maturin
run: |
python -m pip install --upgrade pip
pip install maturin
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Build wheels on macOS and Linux
if: runner.os != 'Windows'
run: |
maturin build --release --skip-auditwheel --out dist
ls -la dist # List contents of dist to verify wheels are built
- name: Build wheels on Windows
if: runner.os == 'Windows'
run: |
# Install Visual Studio Build Tools for Rust on Windows
choco install visualstudio2019buildtools --version=16.11.7
maturin build --release --out dist
dir dist # List contents of dist to verify wheels are built
- name: Upload dist directory as artifact
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist
release:
name: Release
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
name: wheels
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install --upgrade twine
twine upload --skip-existing *