Repository navigation
106 lines (99 loc) · 3.55 KB
/
Copy pathartifacts.yml
File metadata and controls
106 lines (99 loc) · 3.55 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
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
name: Distribution artifacts
# Build reviewable candidates only. This workflow does not publish packages or releases.
on:
workflow_dispatch:
workflow_call:
permissions:
contents: read
concurrency:
group: artifacts-${{ github.ref }}
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
UV_NO_INDEX: '1'
MACOSX_DEPLOYMENT_TARGET: '11.0'
CC: /usr/bin/false
CXX: /usr/bin/false
defaults:
run:
shell: bash
jobs:
wheels:
name: Wheel / ${{ matrix.os }} / ${{ matrix.python }}
strategy:
fail-fast: false
matrix:
os: [macos-15-intel, macos-latest]
python: ['3.11', '3.14t']
runs-on: ${{ matrix.os }}
env:
PYTHON_VERSION: ${{ matrix.python }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
with:
version: '0.12.13'
enable-cache: false
- name: Install Python
run: uv python install "$PYTHON_VERSION"
- name: Install Rust
run: rustup toolchain install stable --profile minimal
- name: Install maturin
uses: taiki-e/install-action@1e29709c0ec63babbe8f266397a465f29a825f91 # v2.87.31
with:
tool: maturin@1.15.0
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
key: artifacts-${{ matrix.python }}
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Build macOS wheel from the source archive
run: |
interpreter="$(uv python find "$PYTHON_VERSION")"
maturin build --sdist --release --locked --compatibility pypi --out dist --interpreter "$interpreter"
- name: Verify wheel contents
run: uv run --no-project --offline --python "$PYTHON_VERSION" python etc/check_artifact.py dist/*.whl
- name: Install wheel without an index
run: |
uv venv --python "$PYTHON_VERSION" .artifact-venv
uv pip install --python .artifact-venv --no-index --no-deps dist/*.whl
- name: Test installed wheel
run: |
if [[ "$PYTHON_VERSION" == *t ]]; then
export PYTHON_GIL=0
fi
uv run --no-project --offline --python .artifact-venv python -m unittest discover -s tests
- name: Upload wheel candidate
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: wheel-${{ matrix.os }}-${{ matrix.python }}
path: dist/*.whl
if-no-files-found: error
sdist:
name: Source distribution
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install maturin
uses: taiki-e/install-action@1e29709c0ec63babbe8f266397a465f29a825f91 # v2.87.31
with:
tool: maturin@1.15.0
- name: Install Rust
run: rustup toolchain install stable --profile minimal
- name: Build source distribution
run: maturin sdist --out dist
- name: Verify source contents
run: python3 etc/check_artifact.py dist/*.tar.gz
- name: Upload source candidate
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: source-distribution
path: dist/*.tar.gz
if-no-files-found: error