-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (103 loc) · 2.99 KB
/
python.yaml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: python
on: [push, pull_request, workflow_dispatch]
jobs:
build_wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ubuntu-latest
target: [x86_64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: true
- name: symlink gfortran (macOS)
if: runner.os == 'macOS'
run: |
ln -s /usr/local/bin/gfortran-12 /usr/local/bin/gfortran
gfortran --version
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: x64
- name: build wheel
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --zig --release --out dist
manylinux: auto
sccache: true
# - name: delocate wheel (macOS)
# if: runner.os == 'macOS'
# run: |
# pip install delocate
# delocate-wheel -v dist/*.whl
# - name: install built wheel
# if: ${{ matrix.target }} == 'x86_64-unknown-linux-gnu'
# run: |
# pip install optik-py --no-index --find-links dist
# python -c "import optik"
- name: upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
- if: github.ref == 'refs/heads/master'
name: update prerelease tag
uses: EndBug/[email protected]
with:
ref: "prerelease"
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist --manifest-path crates/optik-py/Cargo.toml
- name: upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
prerelease:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
concurrency:
group: push-${{ github.ref_name }}-prerelease
cancel-in-progress: true
needs: [build_wheels, sdist]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
path: wheels
- name: GitHub release
uses: ncipollo/[email protected]
with:
prerelease: true
tag: "prerelease"
name: "Development Build"
allowUpdates: true
removeArtifacts: true
replacesArtifacts: true
makeLatest: true
artifacts: "wheels/*"
publish:
name: publish to PyPI
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [build_wheels, sdist]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing *