Skip to content

Commit 404eae5

Browse files
committed
Do not give workflow boolean inputs default values
1 parent d2bef3c commit 404eae5

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ on:
66
- 'v*'
77
workflow_dispatch:
88
inputs:
9-
publish:
10-
description: 'Publish to PyPI (uncheck for dry run)'
9+
dry_run:
10+
description: 'Dry run (do not publish to PyPi)'
1111
required: false
1212
type: boolean
13-
default: true
13+
# Caveat: The type of default value is string, so we should not provide
14+
# one otherwise "inputs.dry_run" could be either boolean or string.
1415
dev_release:
1516
description: 'Development release (DEV_RELEASE=1)'
1617
required: false
1718
type: boolean
18-
default: false
1919

2020
permissions:
2121
contents: read
@@ -29,7 +29,7 @@ jobs:
2929
- uses: ./.github/actions/build-docs
3030

3131
deploy_documentation:
32-
if: ${{ github.event_name == 'push' || inputs.publish }}
32+
if: ${{ !inputs.dry_run }}
3333
needs: build_documentation
3434
permissions:
3535
pages: write
@@ -161,7 +161,7 @@ jobs:
161161
permissions:
162162
id-token: write
163163
environment:
164-
name: pypi
164+
name: ${{ inputs.dry_run && 'none' || 'pypi' }}
165165
url: https://pypi.org/p/mlx
166166
steps:
167167
- uses: actions/download-artifact@v7
@@ -177,7 +177,7 @@ jobs:
177177
- name: Display structure of downloaded files
178178
run: du -ah dist
179179
- name: Publish package distributions to PyPI
180-
if: ${{ github.event_name == 'push' || inputs.publish }}
180+
if: ${{ !inputs.dry_run }}
181181
uses: pypa/gh-action-pypi-publish@release/v1
182182
with:
183183
repository-url: https://upload.pypi.org/legacy/
@@ -189,7 +189,7 @@ jobs:
189189
permissions:
190190
id-token: write
191191
environment:
192-
name: pypi
192+
name: ${{ inputs.dry_run && 'none' || 'pypi' }}
193193
url: https://pypi.org/p/mlx-cuda
194194
steps:
195195
- uses: actions/download-artifact@v7
@@ -200,7 +200,7 @@ jobs:
200200
- name: Display structure of downloaded files
201201
run: du -ah dist
202202
- name: Publish package distributions to PyPI
203-
if: ${{ github.event_name == 'push' || inputs.publish }}
203+
if: ${{ !inputs.dry_run }}
204204
uses: pypa/gh-action-pypi-publish@release/v1
205205
with:
206206
repository-url: https://upload.pypi.org/legacy/
@@ -212,7 +212,7 @@ jobs:
212212
permissions:
213213
id-token: write
214214
environment:
215-
name: pypi
215+
name: ${{ inputs.dry_run && 'none' || 'pypi' }}
216216
url: https://pypi.org/p/mlx-cpu
217217
steps:
218218
- uses: actions/download-artifact@v7
@@ -223,7 +223,7 @@ jobs:
223223
- name: Display structure of downloaded files
224224
run: du -ah dist
225225
- name: Publish package distributions to PyPI
226-
if: ${{ github.event_name == 'push' || inputs.publish }}
226+
if: ${{ !inputs.dry_run }}
227227
uses: pypa/gh-action-pypi-publish@release/v1
228228
with:
229229
repository-url: https://upload.pypi.org/legacy/
@@ -235,7 +235,7 @@ jobs:
235235
permissions:
236236
id-token: write
237237
environment:
238-
name: pypi
238+
name: ${{ inputs.dry_run && 'none' || 'pypi' }}
239239
url: https://pypi.org/p/mlx-metal
240240
steps:
241241
- uses: actions/download-artifact@v7
@@ -245,7 +245,7 @@ jobs:
245245
- name: Display structure of downloaded files
246246
run: du -ah dist
247247
- name: Publish package distributions to PyPI
248-
if: ${{ github.event_name == 'push' || inputs.publish }}
248+
if: ${{ !inputs.dry_run }}
249249
uses: pypa/gh-action-pypi-publish@release/v1
250250
with:
251251
repository-url: https://upload.pypi.org/legacy/

0 commit comments

Comments
 (0)