Merge pull request #675 from epage/maturin

feat(ci): Experiment with publishing to PyPI
This commit is contained in:
Ed Page 2023-03-08 21:12:45 -06:00 committed by GitHub
commit b34ed584fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 128 additions and 0 deletions

107
.github/workflows/maturin.yml vendored Normal file
View file

@ -0,0 +1,107 @@
# This file is autogenerated by maturin v0.14.15
# To update, run
#
# maturin generate-ci github
#
on:
push:
branches:
- master
tags:
- "v*.*.*"
- "!varcon*"
# pull_request: # Only enabled for testing
permissions:
contents: read
jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, x86, aarch64]
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
macos:
runs-on: macos-latest
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --skip-existing *

View file

@ -32,6 +32,9 @@ edition.workspace = true
rust-version.workspace = true rust-version.workspace = true
include.workspace = true include.workspace = true
[package.metadata.maturin]
name = "typos"
[package.metadata.docs.rs] [package.metadata.docs.rs]
no-default-features = true no-default-features = true

18
pyproject.toml Normal file
View file

@ -0,0 +1,18 @@
[build-system]
requires = ["maturin>=0.14,<0.15"]
build-backend = "maturin"
[project]
name = "typos"
requires-python = ">=3.7"
classifiers = [
"Intended Audience :: Developers",
"Topic :: Software Development",
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
[tool.maturin]
bindings = "bin"