Skip to content

Commit 60f1207

Browse files
committed
Add build script
1 parent 2e38075 commit 60f1207

1 file changed

Lines changed: 34 additions & 62 deletions

File tree

Lines changed: 34 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# This file is autogenerated by maturin v1.7.1
1+
# This file is autogenerated by maturin v1.8.3
22
# To update, run
33
#
4-
# maturin generate-ci github --pytest
4+
# maturin generate-ci github --platform manylinux windows macos --output .github/workflows/CI.yml
55
#
6-
name: Build and Test Artifacts
7-
6+
name: CD
87
on:
98
push:
109
branches:
@@ -13,22 +12,26 @@ on:
1312
- '*'
1413
pull_request:
1514
workflow_dispatch:
16-
1715
permissions:
1816
contents: read
19-
2017
jobs:
2118
linux:
2219
runs-on: ${{ matrix.platform.runner }}
2320
strategy:
2421
matrix:
2522
platform:
26-
- runner: ubuntu-latest
23+
- runner: ubuntu-22.04
2724
target: x86_64
28-
- runner: ubuntu-latest
25+
- runner: ubuntu-22.04
2926
target: x86
30-
- runner: ubuntu-latest
27+
- runner: ubuntu-22.04
3128
target: aarch64
29+
- runner: ubuntu-22.04
30+
target: armv7
31+
- runner: ubuntu-22.04
32+
target: s390x
33+
- runner: ubuntu-22.04
34+
target: ppc64le
3235
steps:
3336
- uses: actions/checkout@v4
3437
- uses: actions/setup-python@v5
@@ -39,39 +42,13 @@ jobs:
3942
with:
4043
target: ${{ matrix.platform.target }}
4144
args: --release --out dist --find-interpreter
42-
sccache: 'true'
45+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
4346
manylinux: auto
4447
- name: Upload wheels
4548
uses: actions/upload-artifact@v4
4649
with:
4750
name: wheels-linux-${{ matrix.platform.target }}
4851
path: dist
49-
- name: pytest
50-
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
51-
shell: bash
52-
run: |
53-
set -e
54-
python3 -m venv .venv
55-
source .venv/bin/activate
56-
pip install smirk --find-links dist --force-reinstall
57-
pip install pytest
58-
pytest
59-
- name: pytest
60-
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
61-
uses: uraimo/run-on-arch-action@v2
62-
with:
63-
arch: ${{ matrix.platform.target }}
64-
distro: ubuntu22.04
65-
githubToken: ${{ github.token }}
66-
install: |
67-
apt-get update
68-
apt-get install -y --no-install-recommends python3 python3-pip
69-
pip3 install -U pip pytest
70-
run: |
71-
set -e
72-
pip3 install smirk --find-links dist --force-reinstall
73-
pytest
74-
7552
windows:
7653
runs-on: ${{ matrix.platform.runner }}
7754
strategy:
@@ -92,29 +69,18 @@ jobs:
9269
with:
9370
target: ${{ matrix.platform.target }}
9471
args: --release --out dist --find-interpreter
95-
sccache: 'true'
72+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
9673
- name: Upload wheels
9774
uses: actions/upload-artifact@v4
9875
with:
9976
name: wheels-windows-${{ matrix.platform.target }}
10077
path: dist
101-
- name: pytest
102-
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
103-
shell: bash
104-
run: |
105-
set -e
106-
python3 -m venv .venv
107-
source .venv/Scripts/activate
108-
pip install smirk --find-links dist --force-reinstall
109-
pip install pytest
110-
pytest
111-
11278
macos:
11379
runs-on: ${{ matrix.platform.runner }}
11480
strategy:
11581
matrix:
11682
platform:
117-
- runner: macos-12
83+
- runner: macos-13
11884
target: x86_64
11985
- runner: macos-14
12086
target: aarch64
@@ -128,21 +94,12 @@ jobs:
12894
with:
12995
target: ${{ matrix.platform.target }}
13096
args: --release --out dist --find-interpreter
131-
sccache: 'true'
97+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
13298
- name: Upload wheels
13399
uses: actions/upload-artifact@v4
134100
with:
135101
name: wheels-macos-${{ matrix.platform.target }}
136102
path: dist
137-
- name: pytest
138-
run: |
139-
set -e
140-
python3 -m venv .venv
141-
source .venv/bin/activate
142-
pip install smirk --find-links dist --force-reinstall
143-
pip install pytest
144-
pytest
145-
146103
sdist:
147104
runs-on: ubuntu-latest
148105
steps:
@@ -157,15 +114,30 @@ jobs:
157114
with:
158115
name: wheels-sdist
159116
path: dist
160-
161117
release:
162118
name: Release
163119
runs-on: ubuntu-latest
164-
if: "startsWith(github.ref, 'refs/tags/')"
165-
needs: [linux, windows, macos, sdist]
120+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
121+
needs:
122+
- linux
123+
- windows
124+
- macos
125+
- sdist
126+
permissions:
127+
# Use to sign the release artifacts
128+
id-token: write
129+
# Used to upload release artifacts
130+
contents: write
131+
# Used to generate artifact attestation
132+
attestations: write
166133
steps:
167134
- uses: actions/download-artifact@v4
135+
- name: Generate artifact attestation
136+
uses: actions/attest-build-provenance@v2
137+
with:
138+
subject-path: wheels-*/*
168139
- name: Publish to PyPI
140+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
169141
uses: PyO3/maturin-action@v1
170142
env:
171143
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)