Skip to content

Commit

Permalink
Add maturin build workflow (#24)
Browse files Browse the repository at this point in the history
* Add maturin build workflow

* Fixing sdist, maturin versions

* Only build on `v*` tags.

* Removing trigger for pull_request and workflow
  • Loading branch information
remkade authored Apr 3, 2023
1 parent 844f623 commit ed7c707
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 2 deletions.
115 changes: 115 additions & 0 deletions .github/workflows/maturin-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# This file is autogenerated by maturin v0.14.16
# To update, run
#
# maturin generate-ci github
#
on:
push:
branches:
- main
tags:
- 'v*'

permissions:
contents: read

jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
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]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
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
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
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 target/wheels
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: target/wheels/*.tar.gz

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 *
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
build-backend = "maturin"
requires = ["maturin<=0.13,<0.14"]
requires = ["maturin>=0.14,<0.15"]

[project]
name = "rust_matchspec"
Expand All @@ -10,4 +10,4 @@ requires-python = ">=3.7"

[tool.maturin]
features = ["python"]
python-source = "python"
python-source = "python"

0 comments on commit ed7c707

Please sign in to comment.