Skip to content

Commit

Permalink
0.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Filimoa committed Dec 11, 2024
1 parent bfaa661 commit 5061966
Showing 1 changed file with 82 additions and 60 deletions.
142 changes: 82 additions & 60 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -1,108 +1,142 @@

name: CI

on:
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
push:
branches:
- main
- master
tags:
- '*'
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
linux_tests:
linux-just-test:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.11", "3.13"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up Rust
run: rustup show
- uses: mozilla-actions/sccache-action@v0.0.3
- run: make .venv
- uses: mozilla-actions/sccache-action@v0.0.6
- run: make venv
- run: make pre-commit
- run: make install
- run: make test

linux:
linux-min-versions-just-test:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, x86]
target: [x86_64]
python-version: ["3.9"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up Rust
run: rustup show
- uses: mozilla-actions/sccache-action@v0.0.6
- run: make venv
- run: .venv/bin/python -m pip install polars==1.5.0 # min version
- run: make install
- run: make test

linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-22.04
target: aarch64
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.target }}
name: wheels-linux-${{ matrix.platform.target }}
path: dist

windows:
runs-on: windows-latest
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
target: [x64]
platform:
- runner: windows-latest
target: x64
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
python-version: 3.x
architecture: ${{ matrix.platform.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.target }}
name: wheels-windows-${{ matrix.platform.target }}
path: dist

macos:
runs-on: macos-latest
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
target: [x86_64, aarch64]
platform:
- runner: macos-13
target: x86_64
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.target }}
name: wheels-macos-${{ matrix.platform.target }}
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
Expand All @@ -111,39 +145,27 @@ jobs:
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-sdist
path: dist

release:
name: Release
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
runs-on: ubuntu-latest
environment: pypi
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
needs: [linux, windows, macos, sdist]
permissions:
# Permissions for the trusted publisher workflow
id-token: write
contents: write
steps:
- uses: actions/download-artifact@v4
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
name: wheels-linux-x86_64
- uses: actions/download-artifact@v4
with:
name: wheels-linux-x86
- uses: actions/download-artifact@v4
with:
name: wheels-windows-x64
- uses: actions/download-artifact@v4
with:
name: wheels-macos-x86_64
- uses: actions/download-artifact@v4
with:
name: wheels-macos-aarch64
- uses: actions/download-artifact@v4
with:
name: wheels # the sdist

subject-path: 'wheels-*/*'
- name: Publish to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: PyO3/maturin-action@v1
with:
command: upload
args: --non-interactive --skip-existing *
args: --non-interactive --skip-existing wheels-*/*

0 comments on commit 5061966

Please sign in to comment.