|
15 | 15 | - maintenance/**
|
16 | 16 | push:
|
17 | 17 | branches:
|
18 |
| - - main # FOR TESTING |
19 |
| - tags: |
20 |
| - - v* |
| 18 | + - main # FOR TESTING ONLY |
21 | 19 | workflow_dispatch:
|
| 20 | + inputs: |
| 21 | + environment: |
| 22 | + description: Which PyPI environment to upload to, if any |
| 23 | + required: true |
| 24 | + type: choice |
| 25 | + options: ["none", "testpypi", "pypi"] |
22 | 26 |
|
23 | 27 | concurrency:
|
24 | 28 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
70 | 74 | - buildplat: [ macos13, macosx_x86_64, openblas ]
|
71 | 75 | python: "cp314t"
|
72 | 76 |
|
73 |
| - env: |
74 |
| - IS_32_BIT: ${{ matrix.buildplat[1] == 'win32' }} |
75 | 77 | steps:
|
76 | 78 | - name: Checkout numpy-release
|
77 | 79 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
@@ -138,12 +140,12 @@ jobs:
|
138 | 140 | CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
|
139 | 141 | run: |
|
140 | 142 | python -m pip install cibuildwheel==3.1.0
|
141 |
| - python -m cibuildwheel numpy-src --config-file cibuildwheel.toml --output-dir ./wheelhouse |
| 143 | + python -m cibuildwheel numpy-src --config-file cibuildwheel.toml --output-dir ./dist |
142 | 144 |
|
143 | 145 | - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
144 | 146 | with:
|
145 | 147 | name: ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }}
|
146 |
| - path: ./wheelhouse/*.whl |
| 148 | + path: ./dist/*.whl |
147 | 149 |
|
148 | 150 | build_sdist:
|
149 | 151 | name: Build sdist
|
@@ -174,36 +176,47 @@ jobs:
|
174 | 176 | path: ./dist/*
|
175 | 177 |
|
176 | 178 | testpypi-publish:
|
177 |
| - name: Upload release to TestPyPI |
178 |
| - if: # TODO - add a release True/False? and on `main`? |
| 179 | + name: Publish release to TestPyPI |
| 180 | + if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'testpypi' |
179 | 181 | needs: [build_wheels, build_sdist]
|
180 | 182 | runs-on: ubuntu-latest
|
181 | 183 | environment:
|
182 |
| - name: pypi |
183 |
| - url: https://pypi.org/p/numpy |
| 184 | + name: testpypi |
| 185 | + url: https://test.pypi.org/p/numpy |
184 | 186 | permissions:
|
185 |
| - id-token: write |
| 187 | + id-token: write # mandatory for trusted publishing |
186 | 188 | steps:
|
187 |
| - # TODO: retrieve your distributions here |
| 189 | + - name: Download sdist and wheels |
| 190 | + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v.4.3.0 |
| 191 | + with: |
| 192 | + path: dist |
188 | 193 |
|
189 |
| - - name: Publish package distributions to PyPI |
190 |
| - uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 |
191 |
| - with: |
192 |
| - print-hash: true |
| 194 | + - name: Publish |
| 195 | + uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 |
| 196 | + with: |
| 197 | + repository-url: https://test.pypi.org/legacy/ |
| 198 | + skip-existing: true |
| 199 | + print-hash: true |
| 200 | + attestations: true |
193 | 201 |
|
194 | 202 | pypi-publish:
|
195 |
| - name: Upload release to PyPI |
| 203 | + name: Publish release to PyPI |
| 204 | + if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'pypi' |
196 | 205 | needs: [build_wheels, build_sdist]
|
197 | 206 | runs-on: ubuntu-latest
|
198 | 207 | environment:
|
199 | 208 | name: pypi
|
200 | 209 | url: https://pypi.org/p/numpy
|
201 | 210 | permissions:
|
202 |
| - id-token: write |
| 211 | + id-token: write # mandatory for trusted publishing |
203 | 212 | steps:
|
204 |
| - # TODO: retrieve your distributions here |
| 213 | + - name: Download sdist and wheels |
| 214 | + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v.4.3.0 |
| 215 | + with: |
| 216 | + path: dist |
205 | 217 |
|
206 |
| - - name: Publish package distributions to PyPI |
207 |
| - uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 |
208 |
| - with: |
209 |
| - print-hash: true |
| 218 | + - name: Publish |
| 219 | + uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 |
| 220 | + with: |
| 221 | + print-hash: true |
| 222 | + attestations: true |
0 commit comments