Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint

on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.13", "3.14"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Install uv
uses: astral-sh/setup-uv@v2

- name: Run linting
run: bash ./scripts/lint.sh
164 changes: 164 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
name: Release

on:
push:
tags: ["v*"]
workflow_dispatch:
pull_request:
paths:
- pyproject.toml
- Cargo.toml
- .github/workflows/release.yml

permissions:
contents: read

jobs:
sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: false

- name: Build sdist
run: uvx maturin sdist -o dist

- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist/*.tar.gz

build:
name: Build ${{ matrix.platform.name }} - Python ${{ matrix.python-version }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
platform:
- name: x86_64-unknown-linux-gnu
os: ubuntu-latest
target: x86_64
- name: x86_64-pc-windows-msvc
os: windows-latest
target: x86_64
- name: i686-pc-windows-msvc
os: windows-latest
target: i686
- name: x86_64-apple-darwin
os: macos-latest
target: x86_64
- name: aarch64-apple-darwin
os: macos-latest
target: aarch64
exclude:
# Python 3.9 has limited wheel support on some platforms
- python-version: "3.9"
platform:
name: aarch64-apple-darwin

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: false

- name: Set PyO3 environment variables
shell: bash
run: |
echo "UNSAFE_PYO3_BUILD_FREE_THREADED=1" >> $GITHUB_ENV
echo "UNSAFE_PYO3_SKIP_VERSION_CHECK=1" >> $GITHUB_ENV
echo "PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1" >> $GITHUB_ENV

- name: Source common env (Linux only)
if: matrix.platform.os == 'ubuntu-latest'
shell: bash
run: |
source ./scripts/common_env.sh
echo "CC=$CC" >> $GITHUB_ENV
echo "CFLAGS=$CFLAGS" >> $GITHUB_ENV
echo "RUSTFLAGS=$RUSTFLAGS" >> $GITHUB_ENV

- name: Install musl tools (Linux x86_64)
if: matrix.platform.name == 'x86_64-unknown-linux-gnu'
run: sudo apt-get update && sudo apt-get install -y musl-tools

- name: Build wheel (aarch64 macOS)
if: matrix.platform.name == 'aarch64-apple-darwin'
run: uvx maturin build --release -o dist --target aarch64-apple-darwin

- name: Build wheel
if: matrix.platform.name != 'aarch64-apple-darwin'
run: uvx maturin build --release -o dist

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.platform.name }}-py${{ matrix.python-version }}
path: dist/fast_ordset*.whl

publish-pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [sdist, build]
if: startsWith(github.ref, 'refs/tags/')
environment:
name: PyPI
permissions:
id-token: write

steps:
- uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist

publish-github-release:
name: Publish GitHub Release
runs-on: ubuntu-latest
needs: [build, sdist]
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test

on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.13", "3.14"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Install uv
uses: astral-sh/setup-uv@v2

- name: Run tests
run: bash ./scripts/test.sh
Loading
Loading