-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (71 loc) · 2.36 KB
/
Copy pathpython.yml
File metadata and controls
76 lines (71 loc) · 2.36 KB
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
name: python
# Build abi3 wheels (linux + macos, py3.9+) and an sdist for crates/tare-py, then
# (on a version tag) publish to PyPI. Triggered by a version
# tag, or manually via workflow_dispatch to rebuild/re-publish.
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
workflow_dispatch:
permissions:
contents: read
jobs:
build-wheels:
name: build wheel (${{ matrix.os }}, ${{ matrix.target }})
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-14
target: aarch64-apple-darwin
- os: macos-14
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1
with:
target: ${{ matrix.target }}
manylinux: auto
args: --release --out dist -m crates/tare-py/Cargo.toml
sccache: 'true'
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: wheels-${{ matrix.os }}-${{ matrix.target }}
path: dist
build-sdist:
name: build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1
with:
command: sdist
args: --out dist -m crates/tare-py/Cargo.toml
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: sdist
path: dist
pypi-publish:
name: publish to PyPI
needs: [build-wheels, build-sdist]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
pattern: "wheels-*"
merge-multiple: true
path: dist
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: sdist
path: dist
- name: Publish to PyPI (idempotent)
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
with:
packages-dir: dist/
skip-existing: true