Skip to content

use new github actions version #68

use new github actions version

use new github actions version #68

Workflow file for this run

name: Build and Deploy
on:
push:
branches:
- main
jobs:
build-linux:
runs-on: 'ubuntu-latest'
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: PyO3/maturin-action@v1
with:
command: build
args: --release -i python${{ matrix.python-version }}
target: x86_64
manylinux: auto
- name: Upload Python Wheel
uses: actions/upload-artifact@v4
with:
name: python-wheels
path: target/wheels/*.whl
- name: List Wheels
run: ls -l target/wheels/*.whl
build-other:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, self-hosted]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.12"]
exclude:
- os: self-hosted
python-version: "3.8"
- os: self-hosted
python-version: "3.9"
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Install Python requirements
run: python -m pip install maturin
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: stable
components: rustfmt, clippy
- name: Maturin build
uses: PyO3/maturin-action@v1
with:
command: build
args: --release
- name: List Root
run: ls -l .
- name: Upload Python Wheel
uses: actions/upload-artifact@v4
with:
name: python-wheels
path: target/wheels/*.whl
test:
needs: [build-linux]
runs-on: ubuntu-latest
steps:
- name: Download Python Wheels
uses: actions/download-artifact@v4
with:
name: python-wheels
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install Wheels
run: pip install natsort_rs-*-cp311-cp311-manylinux_*_x86_64.whl
- name: Checkout code
uses: actions/checkout@v2
- name: Run Tests
run: rm -rf natsort_rs && python -m unittest discover tests
deploy:
needs: [test, build-other]
runs-on: ubuntu-latest
steps:
- name: Download Python Wheels
uses: actions/download-artifact@v4
with:
name: python-wheels
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install Twine
run: python -m pip install --upgrade twine
- name: List Root
run: ls -l .
- name: Upload to PyPI
run: |
twine upload *.whl
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}