Skip to content

Commit 9e0ef11

Browse files
committed
👷 Update Python CI
1 parent 581424e commit 9e0ef11

File tree

3 files changed

+116
-12
lines changed

3 files changed

+116
-12
lines changed

.github/workflows/python.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file is autogenerated by maturin v1.7.1 (and modified)
1+
# This file is autogenerated by maturin v1.7.8
22
# To update, run
33
#
44
# maturin generate-ci github
@@ -23,17 +23,17 @@ jobs:
2323
strategy:
2424
matrix:
2525
platform:
26-
- runner: ubuntu-latest
26+
- runner: ubuntu-22.04
2727
target: x86_64
28-
- runner: ubuntu-latest
28+
- runner: ubuntu-22.04
2929
target: x86
30-
- runner: ubuntu-latest
30+
- runner: ubuntu-22.04
3131
target: aarch64
32-
- runner: ubuntu-latest
32+
- runner: ubuntu-22.04
3333
target: armv7
34-
- runner: ubuntu-latest
34+
- runner: ubuntu-22.04
3535
target: s390x
36-
- runner: ubuntu-latest
36+
- runner: ubuntu-22.04
3737
target: ppc64le
3838
steps:
3939
- uses: actions/checkout@v4
@@ -58,13 +58,13 @@ jobs:
5858
strategy:
5959
matrix:
6060
platform:
61-
- runner: ubuntu-latest
61+
- runner: ubuntu-22.04
6262
target: x86_64
63-
- runner: ubuntu-latest
63+
- runner: ubuntu-22.04
6464
target: x86
65-
- runner: ubuntu-latest
65+
- runner: ubuntu-22.04
6666
target: aarch64
67-
- runner: ubuntu-latest
67+
- runner: ubuntu-22.04
6868
target: armv7
6969
steps:
7070
- uses: actions/checkout@v4
@@ -116,7 +116,7 @@ jobs:
116116
strategy:
117117
matrix:
118118
platform:
119-
- runner: macos-12
119+
- runner: macos-13
120120
target: x86_64
121121
- runner: macos-14
122122
target: aarch64
@@ -159,9 +159,21 @@ jobs:
159159
needs: [linux, musllinux, windows, macos, sdist]
160160
environment: PyPi
161161
concurrency: PyPi
162+
permissions:
163+
# Use to sign the release artifacts
164+
id-token: write
165+
# Used to upload release artifacts
166+
contents: write
167+
# Used to generate artifact attestation
168+
attestations: write
162169
steps:
163170
- uses: actions/download-artifact@v4
171+
- name: Generate artifact attestation
172+
uses: actions/attest-build-provenance@v1
173+
with:
174+
subject-path: 'wheels-*/*'
164175
- name: Publish to PyPI
176+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
165177
uses: PyO3/maturin-action@v1
166178
env:
167179
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

.github/workflows/python.yml.patch

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
2+
index b4f6ef6..4c7203a 100644
3+
--- a/.github/workflows/python.yml
4+
+++ b/.github/workflows/python.yml
5+
@@ -3,15 +3,14 @@
6+
#
7+
# maturin generate-ci github
8+
#
9+
-name: CI
10+
+name: Python
11+
12+
on:
13+
push:
14+
branches:
15+
- main
16+
- - master
17+
tags:
18+
- - '*'
19+
+ - 'pycolorsaurus-*'
20+
pull_request:
21+
workflow_dispatch:
22+
23+
@@ -45,7 +44,7 @@ jobs:
24+
uses: PyO3/maturin-action@v1
25+
with:
26+
target: ${{ matrix.platform.target }}
27+
- args: --release --out dist --find-interpreter
28+
+ args: --release --out dist --find-interpreter --manifest-path crates/pycolorsaurus/Cargo.toml
29+
sccache: 'true'
30+
manylinux: auto
31+
- name: Upload wheels
32+
@@ -76,7 +75,7 @@ jobs:
33+
uses: PyO3/maturin-action@v1
34+
with:
35+
target: ${{ matrix.platform.target }}
36+
- args: --release --out dist --find-interpreter
37+
+ args: --release --out dist --find-interpreter --manifest-path crates/pycolorsaurus/Cargo.toml
38+
sccache: 'true'
39+
manylinux: musllinux_1_2
40+
- name: Upload wheels
41+
@@ -104,7 +103,7 @@ jobs:
42+
uses: PyO3/maturin-action@v1
43+
with:
44+
target: ${{ matrix.platform.target }}
45+
- args: --release --out dist --find-interpreter
46+
+ args: --release --out dist --find-interpreter --manifest-path crates/pycolorsaurus/Cargo.toml
47+
sccache: 'true'
48+
- name: Upload wheels
49+
uses: actions/upload-artifact@v4
50+
@@ -130,7 +129,7 @@ jobs:
51+
uses: PyO3/maturin-action@v1
52+
with:
53+
target: ${{ matrix.platform.target }}
54+
- args: --release --out dist --find-interpreter
55+
+ args: --release --out dist --find-interpreter --manifest-path crates/pycolorsaurus/Cargo.toml
56+
sccache: 'true'
57+
- name: Upload wheels
58+
uses: actions/upload-artifact@v4
59+
@@ -146,7 +145,7 @@ jobs:
60+
uses: PyO3/maturin-action@v1
61+
with:
62+
command: sdist
63+
- args: --out dist
64+
+ args: --out dist --manifest-path crates/pycolorsaurus/Cargo.toml
65+
- name: Upload sdist
66+
uses: actions/upload-artifact@v4
67+
with:
68+
@@ -156,8 +155,10 @@ jobs:
69+
release:
70+
name: Release
71+
runs-on: ubuntu-latest
72+
- if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
73+
+ if: "startsWith(github.ref, 'refs/tags/pycolorsaurus-')"
74+
needs: [linux, musllinux, windows, macos, sdist]
75+
+ environment: PyPi
76+
+ concurrency: PyPi
77+
permissions:
78+
# Use to sign the release artifacts
79+
id-token: write
80+
@@ -175,7 +176,7 @@ jobs:
81+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
82+
uses: PyO3/maturin-action@v1
83+
env:
84+
- MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
85+
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
86+
with:
87+
command: upload
88+
args: --non-interactive --skip-existing wheels-*/*

Justfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ doc:
1717

1818
update-locked-deps:
1919
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=fallback cargo +nightly -Zmsrv-policy generate-lockfile
20+
21+
update-python-ci:
22+
(cd crates/pycolorsaurus && maturin generate-ci github > ../../.github/workflows/python.yml)
23+
git apply .github/workflows/python.yml.patch

0 commit comments

Comments
 (0)