|
1 |
| -name: "[ptars] Release" |
| 1 | +# This file is autogenerated by maturin v1.7.0 |
| 2 | +# To update, run |
| 3 | +# |
| 4 | +# maturin generate-ci github |
| 5 | +# |
| 6 | +name: "Wheels" |
2 | 7 |
|
3 | 8 | on:
|
4 | 9 | push:
|
| 10 | + branches: |
| 11 | + - main |
5 | 12 | tags:
|
6 |
| - - v* |
| 13 | + - 'v*' |
7 | 14 |
|
8 |
| -concurrency: |
9 |
| - group: ${{ github.workflow }}-${{ github.ref }} |
10 |
| - cancel-in-progress: true |
11 |
| - |
12 |
| -env: |
13 |
| - PACKAGE_NAME: ptars |
14 |
| - CARGO_INCREMENTAL: 0 |
15 |
| - CARGO_NET_RETRY: 10 |
16 |
| - CARGO_TERM_COLOR: always |
17 |
| - RUSTUP_MAX_RETRIES: 10 |
| 15 | +permissions: |
| 16 | + contents: read |
18 | 17 |
|
19 | 18 | jobs:
|
20 |
| - sdist: |
21 |
| - runs-on: ubuntu-latest |
| 19 | + linux: |
| 20 | + runs-on: ${{ matrix.platform.runner }} |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + platform: |
| 24 | + - runner: ubuntu-latest |
| 25 | + target: x86_64 |
| 26 | + - runner: ubuntu-latest |
| 27 | + target: x86 |
| 28 | + - runner: ubuntu-latest |
| 29 | + target: aarch64 |
| 30 | + - runner: ubuntu-latest |
| 31 | + target: armv7 |
| 32 | + - runner: ubuntu-latest |
| 33 | + target: s390x |
| 34 | + - runner: ubuntu-latest |
| 35 | + target: ppc64le |
22 | 36 | steps:
|
23 | 37 | - uses: actions/checkout@v4
|
24 | 38 | - uses: actions/setup-python@v5
|
25 | 39 | with:
|
26 |
| - python-version: "3.11" |
27 |
| - - name: "Build sdist" |
| 40 | + python-version: 3.x |
| 41 | + - name: Build wheels |
28 | 42 | uses: PyO3/maturin-action@v1
|
29 | 43 | with:
|
30 |
| - command: sdist |
31 |
| - args: --out dist |
32 |
| - - name: "Test sdist" |
33 |
| - run: | |
34 |
| - tar -ztvf dist/${{ env.PACKAGE_NAME }}-*.tar.gz |
35 |
| - pip install dist/${{ env.PACKAGE_NAME }}-*.tar.gz --force-reinstall |
36 |
| - python -c "import ptars" |
37 |
| - - name: "Upload sdist" |
38 |
| - uses: actions/upload-artifact@v3 |
| 44 | + target: ${{ matrix.platform.target }} |
| 45 | + args: --release --out dist --find-interpreter |
| 46 | + sccache: 'true' |
| 47 | + manylinux: auto |
| 48 | + - name: Upload wheels |
| 49 | + uses: actions/upload-artifact@v4 |
39 | 50 | with:
|
40 |
| - name: wheels |
| 51 | + name: wheels-linux-${{ matrix.platform.target }} |
41 | 52 | path: dist
|
42 | 53 |
|
43 |
| - macos: |
44 |
| - runs-on: macos-14 |
| 54 | + musllinux: |
| 55 | + runs-on: ${{ matrix.platform.runner }} |
45 | 56 | strategy:
|
46 | 57 | matrix:
|
47 |
| - python-version: |
48 |
| - - "3.10" |
49 |
| - - "3.11" |
50 |
| - - "3.12" |
| 58 | + platform: |
| 59 | + - runner: ubuntu-latest |
| 60 | + target: x86_64 |
| 61 | + - runner: ubuntu-latest |
| 62 | + target: x86 |
| 63 | + - runner: ubuntu-latest |
| 64 | + target: aarch64 |
| 65 | + - runner: ubuntu-latest |
| 66 | + target: armv7 |
51 | 67 | steps:
|
52 | 68 | - uses: actions/checkout@v4
|
53 | 69 | - uses: actions/setup-python@v5
|
54 | 70 | with:
|
55 |
| - python-version: ${{ matrix.python-version }} |
56 |
| - - uses: dtolnay/rust-toolchain@stable |
57 |
| - with: |
58 |
| - targets: aarch64-apple-darwin |
59 |
| - - name: Build wheels - universal2 |
| 71 | + python-version: 3.x |
| 72 | + - name: Build wheels |
60 | 73 | uses: PyO3/maturin-action@v1
|
61 | 74 | with:
|
62 |
| - args: -i python --release --target=universal2-apple-darwin --out dist |
63 |
| - - name: Install build wheel - universal2 |
64 |
| - run: | |
65 |
| - pip install --force-reinstall dist/ptars*_universal2.whl |
66 |
| - cd ~ && python -c 'import ptars' |
| 75 | + target: ${{ matrix.platform.target }} |
| 76 | + args: --release --out dist --find-interpreter |
| 77 | + sccache: 'true' |
| 78 | + manylinux: musllinux_1_2 |
67 | 79 | - name: Upload wheels
|
68 |
| - uses: actions/upload-artifact@v3 |
| 80 | + uses: actions/upload-artifact@v4 |
69 | 81 | with:
|
70 |
| - name: wheels |
| 82 | + name: wheels-musllinux-${{ matrix.platform.target }} |
71 | 83 | path: dist
|
| 84 | + |
72 | 85 | windows:
|
73 |
| - runs-on: windows-latest |
| 86 | + runs-on: ${{ matrix.platform.runner }} |
74 | 87 | strategy:
|
75 | 88 | matrix:
|
76 |
| - python-version: |
77 |
| - - "3.10" |
78 |
| - - "3.11" |
79 |
| - - "3.12" |
80 |
| - target: |
81 |
| - - x64 |
| 89 | + platform: |
| 90 | + - runner: windows-latest |
| 91 | + target: x64 |
| 92 | + - runner: windows-latest |
| 93 | + target: x86 |
82 | 94 | steps:
|
83 | 95 | - uses: actions/checkout@v4
|
84 | 96 | - uses: actions/setup-python@v5
|
85 | 97 | with:
|
86 |
| - python-version: ${{ matrix.python-version }} |
87 |
| - architecture: ${{ matrix.target }} |
88 |
| - - uses: dtolnay/rust-toolchain@stable |
| 98 | + python-version: 3.x |
| 99 | + architecture: ${{ matrix.platform.target }} |
89 | 100 | - name: Build wheels
|
90 | 101 | uses: PyO3/maturin-action@v1
|
91 | 102 | with:
|
92 |
| - target: ${{ matrix.target }} |
93 |
| - args: -i python --release --out dist |
94 |
| - - name: Install build wheel |
95 |
| - shell: bash |
96 |
| - run: | |
97 |
| - pip install --force-reinstall dist/ptars*.whl |
98 |
| - cd ~ && python -c 'import ptars' |
| 103 | + target: ${{ matrix.platform.target }} |
| 104 | + args: --release --out dist --find-interpreter |
| 105 | + sccache: 'true' |
99 | 106 | - name: Upload wheels
|
100 |
| - uses: actions/upload-artifact@v3 |
| 107 | + uses: actions/upload-artifact@v4 |
101 | 108 | with:
|
102 |
| - name: wheels |
| 109 | + name: wheels-windows-${{ matrix.platform.target }} |
103 | 110 | path: dist
|
104 | 111 |
|
105 |
| - linux: |
106 |
| - runs-on: ubuntu-latest |
| 112 | + macos: |
| 113 | + runs-on: ${{ matrix.platform.runner }} |
107 | 114 | strategy:
|
108 | 115 | matrix:
|
109 |
| - python-version: |
110 |
| - - "3.10" |
111 |
| - - "3.11" |
112 |
| - - "3.12" |
113 |
| - target: [x86_64, i686] |
| 116 | + platform: |
| 117 | + - runner: macos-12 |
| 118 | + target: x86_64 |
| 119 | + - runner: macos-14 |
| 120 | + target: aarch64 |
114 | 121 | steps:
|
115 | 122 | - uses: actions/checkout@v4
|
116 |
| - - uses: dtolnay/rust-toolchain@stable |
117 | 123 | - uses: actions/setup-python@v5
|
118 | 124 | with:
|
119 |
| - python-version: ${{ matrix.python-version }} |
120 |
| - - name: Build Wheels |
| 125 | + python-version: 3.x |
| 126 | + - name: Build wheels |
121 | 127 | uses: PyO3/maturin-action@v1
|
122 | 128 | with:
|
123 |
| - target: ${{ matrix.target }} |
124 |
| - manylinux: auto |
125 |
| - args: -i python${{ matrix.python-version }} --release --out dist |
126 |
| - - name: Install build wheel |
127 |
| - if: matrix.target == 'x86_64' |
128 |
| - run: | |
129 |
| - pip install --force-reinstall dist/ptars*.whl |
130 |
| - cd ~ && python -c 'import ptars' |
| 129 | + target: ${{ matrix.platform.target }} |
| 130 | + args: --release --out dist --find-interpreter |
| 131 | + sccache: 'true' |
131 | 132 | - name: Upload wheels
|
132 |
| - uses: actions/upload-artifact@v3 |
| 133 | + uses: actions/upload-artifact@v4 |
133 | 134 | with:
|
134 |
| - name: wheels |
| 135 | + name: wheels-macos-${{ matrix.platform.target }} |
135 | 136 | path: dist
|
136 | 137 |
|
137 |
| - linux-cross: |
| 138 | + sdist: |
138 | 139 | runs-on: ubuntu-latest
|
139 |
| - strategy: |
140 |
| - matrix: |
141 |
| - python: |
142 |
| - [ |
143 |
| - { version: "3.10", abi: "cp310-cp310" }, |
144 |
| - { version: "3.11", abi: "cp311-cp311" }, |
145 |
| - { version: "3.12", abi: "cp312-cp312" }, |
146 |
| - ] |
147 |
| - target: # TODO: armv7 not supported by pyarrow yet |
148 |
| - - aarch64 |
149 | 140 | steps:
|
150 | 141 | - uses: actions/checkout@v4
|
151 |
| - - name: Build Wheels |
| 142 | + - name: Build sdist |
152 | 143 | uses: PyO3/maturin-action@v1
|
153 |
| - env: |
154 |
| - PYO3_CROSS_LIB_DIR: /opt/python/${{ matrix.python.abi }}/lib |
155 | 144 | with:
|
156 |
| - target: ${{ matrix.target }} |
157 |
| - manylinux: auto |
158 |
| - args: -i python${{matrix.python.version}} --release --out dist |
159 |
| - |
160 |
| - name: Install build wheel |
161 |
| - with: |
162 |
| - arch: ${{ matrix.target }} |
163 |
| - distro: ubuntu20.04 |
164 |
| - githubToken: ${{ github.token }} |
165 |
| - # Mount the dist directory as /artifacts in the container |
166 |
| - dockerRunArgs: | |
167 |
| - --volume "${PWD}/dist:/artifacts" |
168 |
| - install: | |
169 |
| - apt update -y |
170 |
| - apt install -y gcc musl-dev python3-dev # this is needed for psutil |
171 |
| - apt install -y --no-install-recommends software-properties-common |
172 |
| - add-apt-repository ppa:deadsnakes/ppa |
173 |
| - apt update -y |
174 |
| - PYTHON=python${{ matrix.python.version }} |
175 |
| - apt install -y $PYTHON $PYTHON-distutils $PYTHON-venv |
176 |
| - run: | |
177 |
| - ls -lrth /artifacts |
178 |
| - PYTHON=python${{ matrix.python.version }} |
179 |
| - $PYTHON --version |
180 |
| - $PYTHON -m venv venv |
181 |
| - source venv/bin/activate |
182 |
| - pip install --upgrade pip setuptools wheel |
183 |
| - pip install --force-reinstall dist/ptars*.whl |
184 |
| - cd ~ && python -c 'import ptars' |
185 |
| - - name: Upload wheels |
186 |
| - uses: actions/upload-artifact@v3 |
| 145 | + command: sdist |
| 146 | + args: --out dist |
| 147 | + - name: Upload sdist |
| 148 | + uses: actions/upload-artifact@v4 |
187 | 149 | with:
|
188 |
| - name: wheels |
| 150 | + name: wheels-sdist |
189 | 151 | path: dist
|
190 | 152 |
|
191 |
| - upload-release: |
192 |
| - name: Upload Release to PyPI |
| 153 | + release: |
| 154 | + name: Release |
193 | 155 | runs-on: ubuntu-latest
|
194 |
| - needs: |
195 |
| - - sdist |
196 |
| - - macos |
197 |
| - - windows |
198 |
| - - linux |
199 |
| - - linux-cross |
| 156 | + if: "startsWith(github.ref, 'refs/tags/')" |
| 157 | + needs: [linux, musllinux, windows, macos, sdist] |
200 | 158 | steps:
|
201 |
| - - name: Download artifacts |
202 |
| - uses: actions/download-artifact@v3 |
203 |
| - with: |
204 |
| - name: wheels |
205 |
| - path: wheels |
206 |
| - - name: List wheels |
207 |
| - shell: bash |
208 |
| - run: | |
209 |
| - ls -ltr wheels/ |
210 |
| - - name: Publish to PyPi |
211 |
| - uses: pypa/gh-action-pypi-publish@release/v1 |
| 159 | + - uses: actions/download-artifact@v4 |
| 160 | + - name: Publish to PyPI |
| 161 | + uses: PyO3/maturin-action@v1 |
| 162 | + env: |
| 163 | + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
212 | 164 | with:
|
213 |
| - skip-existing: true |
214 |
| - packages-dir: wheels |
215 |
| - verbose: true |
216 |
| - password: ${{ secrets.PYPI_API_TOKEN }} |
| 165 | + command: upload |
| 166 | + args: --non-interactive --skip-existing wheels-*/* |
0 commit comments