Skip to content

Commit 0b52651

Browse files
committed
CI: updated upload-artifact to v4
1 parent 3c8fac7 commit 0b52651

File tree

1 file changed

+95
-37
lines changed

1 file changed

+95
-37
lines changed

.github/workflows/python.yml

+95-37
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,141 @@
1-
# This file is autogenerated by maturin v1.4.0
1+
# This file is autogenerated by maturin v1.8.2
22
# To update, run
33
#
4-
# maturin generate-ci github
4+
# maturin generate-ci github --manifest-path Cargo.toml
55
#
6-
name: argmin-testfunctions-py
6+
name: CI
77

88
on:
99
push:
1010
branches:
1111
- main
12+
- master
1213
tags:
13-
- 'argmin-testfunctions-py-v*'
14+
- '*'
1415
pull_request:
1516
workflow_dispatch:
1617

17-
defaults:
18-
run:
19-
working-directory: ./python/argmin-testfunctions-py
20-
2118
permissions:
2219
contents: read
2320

2421
jobs:
2522
linux:
26-
runs-on: ubuntu-latest
23+
runs-on: ${{ matrix.platform.runner }}
2724
strategy:
2825
matrix:
29-
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
26+
platform:
27+
- runner: ubuntu-22.04
28+
target: x86_64
29+
- runner: ubuntu-22.04
30+
target: x86
31+
- runner: ubuntu-22.04
32+
target: aarch64
33+
- runner: ubuntu-22.04
34+
target: armv7
35+
- runner: ubuntu-22.04
36+
target: s390x
37+
- runner: ubuntu-22.04
38+
target: ppc64le
3039
steps:
3140
- uses: actions/checkout@v4
3241
- uses: actions/setup-python@v5
3342
with:
34-
python-version: '3.10'
43+
python-version: 3.x
3544
- name: Build wheels
3645
uses: PyO3/maturin-action@v1
3746
with:
38-
target: ${{ matrix.target }}
47+
target: ${{ matrix.platform.target }}
3948
args: --release --out dist --find-interpreter --manifest-path python/argmin-testfunctions-py/Cargo.toml
40-
sccache: 'true'
49+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
4150
manylinux: auto
4251
- name: Upload wheels
43-
uses: actions/upload-artifact@v3
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: wheels-linux-${{ matrix.platform.target }}
55+
path: dist
56+
57+
musllinux:
58+
runs-on: ${{ matrix.platform.runner }}
59+
strategy:
60+
matrix:
61+
platform:
62+
- runner: ubuntu-22.04
63+
target: x86_64
64+
- runner: ubuntu-22.04
65+
target: x86
66+
- runner: ubuntu-22.04
67+
target: aarch64
68+
- runner: ubuntu-22.04
69+
target: armv7
70+
steps:
71+
- uses: actions/checkout@v4
72+
- uses: actions/setup-python@v5
73+
with:
74+
python-version: 3.x
75+
- name: Build wheels
76+
uses: PyO3/maturin-action@v1
77+
with:
78+
target: ${{ matrix.platform.target }}
79+
args: --release --out dist --find-interpreter --manifest-path python/argmin-testfunctions-py/Cargo.toml
80+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
81+
manylinux: musllinux_1_2
82+
- name: Upload wheels
83+
uses: actions/upload-artifact@v4
4484
with:
45-
name: wheels
85+
name: wheels-musllinux-${{ matrix.platform.target }}
4686
path: dist
4787

4888
windows:
49-
runs-on: windows-latest
89+
runs-on: ${{ matrix.platform.runner }}
5090
strategy:
5191
matrix:
52-
target: [x64, x86]
92+
platform:
93+
- runner: windows-latest
94+
target: x64
95+
- runner: windows-latest
96+
target: x86
5397
steps:
5498
- uses: actions/checkout@v4
5599
- uses: actions/setup-python@v5
56100
with:
57-
python-version: '3.10'
58-
architecture: ${{ matrix.target }}
101+
python-version: 3.x
102+
architecture: ${{ matrix.platform.target }}
59103
- name: Build wheels
60104
uses: PyO3/maturin-action@v1
61105
with:
62-
target: ${{ matrix.target }}
106+
target: ${{ matrix.platform.target }}
63107
args: --release --out dist --find-interpreter --manifest-path python/argmin-testfunctions-py/Cargo.toml
64-
sccache: 'true'
108+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
65109
- name: Upload wheels
66-
uses: actions/upload-artifact@v3
110+
uses: actions/upload-artifact@v4
67111
with:
68-
name: wheels
112+
name: wheels-windows-${{ matrix.platform.target }}
69113
path: dist
70114

71115
macos:
72-
runs-on: macos-latest
116+
runs-on: ${{ matrix.platform.runner }}
73117
strategy:
74118
matrix:
75-
target: [x86_64, aarch64]
119+
platform:
120+
- runner: macos-13
121+
target: x86_64
122+
- runner: macos-14
123+
target: aarch64
76124
steps:
77125
- uses: actions/checkout@v4
78126
- uses: actions/setup-python@v5
79127
with:
80-
python-version: '3.10'
128+
python-version: 3.x
81129
- name: Build wheels
82130
uses: PyO3/maturin-action@v1
83131
with:
84-
target: ${{ matrix.target }}
132+
target: ${{ matrix.platform.target }}
85133
args: --release --out dist --find-interpreter --manifest-path python/argmin-testfunctions-py/Cargo.toml
86-
sccache: 'true'
134+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
87135
- name: Upload wheels
88-
uses: actions/upload-artifact@v3
136+
uses: actions/upload-artifact@v4
89137
with:
90-
name: wheels
138+
name: wheels-macos-${{ matrix.platform.target }}
91139
path: dist
92140

93141
sdist:
@@ -100,24 +148,34 @@ jobs:
100148
command: sdist
101149
args: --out dist --manifest-path python/argmin-testfunctions-py/Cargo.toml
102150
- name: Upload sdist
103-
uses: actions/upload-artifact@v3
151+
uses: actions/upload-artifact@v4
104152
with:
105-
name: wheels
153+
name: wheels-sdist
106154
path: dist
107155

108156
release:
109157
name: Release
110158
runs-on: ubuntu-latest
111-
if: "startsWith(github.ref, 'refs/tags/argmin-testfunctions-py-v')"
112-
needs: [linux, windows, macos, sdist]
159+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
160+
needs: [linux, musllinux, windows, macos, sdist]
161+
permissions:
162+
# Use to sign the release artifacts
163+
id-token: write
164+
# Used to upload release artifacts
165+
contents: write
166+
# Used to generate artifact attestation
167+
attestations: write
113168
steps:
114-
- uses: actions/download-artifact@v3
169+
- uses: actions/download-artifact@v4
170+
- name: Generate artifact attestation
171+
uses: actions/attest-build-provenance@v1
115172
with:
116-
name: wheels
173+
subject-path: 'wheels-*/*'
117174
- name: Publish to PyPI
175+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
118176
uses: PyO3/maturin-action@v1
119177
env:
120178
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
121179
with:
122180
command: upload
123-
args: --non-interactive --skip-existing *
181+
args: --non-interactive --skip-existing wheels-*/*

0 commit comments

Comments
 (0)