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
37 changes: 34 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build
name: Build and Release

on:
push:
tags:
- 'v[0-9].[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
pull_request:

Expand Down Expand Up @@ -40,6 +40,37 @@ jobs:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_abi3_wheels:
name: Build abi3 wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14]

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
with:
enable-cache: false

- name: Build wheels
uses: pypa/cibuildwheel@faf86a6ed7efa889faf6996aa23820831055001a # v2.23.3
env:
CIBW_BUILD: cp39-*
CIBW_CONFIG_SETTINGS: build-args="--features abi3"

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: cibw-abi3-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
name: Build sdist
Expand All @@ -61,7 +92,7 @@ jobs:

publish:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: [build_wheels, build_sdist]
needs: [build_wheels, build_abi3_wheels, build_sdist]
environment: pypi
permissions:
id-token: write # https://docs.pypi.org/trusted-publishers/using-a-publisher/#github-actions
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,14 @@ on:
- 'tests/**'
- 'noxfile.py'
- '.github/workflows/tests.yml'
pull_request:
branches:
- main
paths:
- 'src/**'
- 'tests/**'
- 'noxfile.py'
- '.github/workflows/tests.yml'
workflow_dispatch:

env:
FORCE_COLOR: 1
UV_LOCKED: 1

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ pyo3 = { version = "0.24.2", features = [
"generate-import-lib",
] }
tempfile = "3.19.1"

[features]
abi3 = ["pyo3/abi3-py39"]
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def lint(session: nox.Session) -> None:
else:
# Fix any fixable errors if running locally.
cargo(session, "fmt")
cargo(session, "clippy", "--fix", "--lib", "-p", "atomicwriter", "--allow-dirty")
cargo(session, "clippy", "--fix", "--lib", "-p", "atomicwriter")
session.run("ruff", "check", ".", "--fix")
session.run("ruff", "format", ".")

Expand Down