-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (57 loc) · 1.5 KB
/
python.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Python
on:
push:
branches: [ "main" ]
tags:
- '*'
pull_request:
branches: [ "main" ]
env:
PACKAGE_NAME: rocraters
PYTHON_VERSION: "3.7" # to build abi3 wheels
# Modified slightly from crfs-rs Python.yml
jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
args: --release --out dist -m python/Cargo.toml
- name: Install built wheel
if: matrix.target == 'x86_64'
run: |
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --no-index --find-links dist --force-reinstall
python -c "import rocraters"
- name: Upload wheels
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]
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
with:
command: upload
args: --repository=testpypi --non-interactive --skip-existing -m python/cargo.toml