Skip to content

Commit 91a2503

Browse files
committed
Allow dry run for PyPI release workflow
1 parent 7ddeb70 commit 91a2503

1 file changed

Lines changed: 21 additions & 20 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,26 @@ on:
66
- 'v*'
77
workflow_dispatch:
88
inputs:
9+
dry_run:
10+
description: 'Dry run (use "false" to publish to PyPI)'
11+
required: true
12+
default: 'false'
913
dev_release:
10-
description: "Do a dev release or regular release"
14+
description: 'Dev release (use "false" to do a regular release)'
1115
required: true
12-
default: "false"
16+
default: 'false'
1317

1418
permissions:
1519
contents: read
1620

1721
jobs:
18-
setup:
19-
runs-on: ubuntu-latest
20-
steps:
21-
- name: Set publishing variables
22-
run: echo "Publishing setup complete"
23-
2422
build_documentation:
2523
if: github.repository == 'ml-explore/mlx'
2624
runs-on: ubuntu-22.04
2725
steps:
2826
- uses: actions/checkout@v6
2927
- uses: ./.github/actions/build-docs
30-
28+
3129
deploy_documentation:
3230
needs: build_documentation
3331
permissions:
@@ -77,7 +75,7 @@ jobs:
7775
name: mlx-cpu-${{ matrix.arch }}
7876
path: wheelhouse/mlx_cpu-*.whl
7977
if-no-files-found: error
80-
78+
8179
build_mac_release:
8280
if: github.repository == 'ml-explore/mlx'
8381
strategy:
@@ -87,7 +85,6 @@ jobs:
8785
env:
8886
PYPI_RELEASE: 1
8987
DEV_RELEASE: ${{ github.event.inputs.dev_release == 'true' && 1 || 0 }}
90-
9188
steps:
9289
- uses: actions/checkout@v6
9390
- uses: ./.github/actions/setup-macos
@@ -162,7 +159,7 @@ jobs:
162159
pypi-publish:
163160
name: Upload release to PyPI
164161
runs-on: ubuntu-latest
165-
needs: [setup, build_linux_release, build_mac_release]
162+
needs: [build_linux_release, build_mac_release]
166163
permissions:
167164
id-token: write
168165
environment:
@@ -180,16 +177,17 @@ jobs:
180177
merge-multiple: true
181178
path: dist
182179
- name: Display structure of downloaded files
183-
run: ls -R dist
180+
run: ls -lR dist
184181
- name: Publish package distributions to PyPI
182+
if: github.event.inputs.dry_run == 'false'
185183
uses: pypa/gh-action-pypi-publish@release/v1
186184
with:
187185
repository-url: https://upload.pypi.org/legacy/
188-
186+
189187
pypi-publish-cuda:
190188
name: Upload CUDA release to PyPI
191189
runs-on: ubuntu-latest
192-
needs: [setup, build_cuda_release]
190+
needs: [build_cuda_release]
193191
permissions:
194192
id-token: write
195193
environment:
@@ -201,16 +199,17 @@ jobs:
201199
name: mlx-cuda-*
202200
path: dist
203201
- name: Display structure of downloaded files
204-
run: ls -R dist
202+
run: ls -lR dist
205203
- name: Publish package distributions to PyPI
204+
if: github.event.inputs.dry_run == 'false'
206205
uses: pypa/gh-action-pypi-publish@release/v1
207206
with:
208207
repository-url: https://upload.pypi.org/legacy/
209208

210209
pypi-publish-cpu:
211210
name: Upload CPU release to PyPI
212211
runs-on: ubuntu-latest
213-
needs: [setup, build_linux_release]
212+
needs: [build_linux_release]
214213
permissions:
215214
id-token: write
216215
environment:
@@ -223,16 +222,17 @@ jobs:
223222
merge-multiple: true
224223
path: dist
225224
- name: Display structure of downloaded files
226-
run: ls -R dist
225+
run: ls -lR dist
227226
- name: Publish package distributions to PyPI
227+
if: github.event.inputs.dry_run == 'false'
228228
uses: pypa/gh-action-pypi-publish@release/v1
229229
with:
230230
repository-url: https://upload.pypi.org/legacy/
231231

232232
pypi-publish-metal:
233233
name: Upload Metal release to PyPI
234234
runs-on: ubuntu-latest
235-
needs: [setup, build_mac_release]
235+
needs: [build_mac_release]
236236
permissions:
237237
id-token: write
238238
environment:
@@ -244,8 +244,9 @@ jobs:
244244
name: mlx-metal
245245
path: dist
246246
- name: Display structure of downloaded files
247-
run: ls -R dist
247+
run: ls -lR dist
248248
- name: Publish package distributions to PyPI
249+
if: github.event.inputs.dry_run == 'false'
249250
uses: pypa/gh-action-pypi-publish@release/v1
250251
with:
251252
repository-url: https://upload.pypi.org/legacy/

0 commit comments

Comments
 (0)