Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ on:
push:
tags:
- 'v*'
branches:
- 'test-publish/*'
workflow_dispatch:
inputs:
publish:
description: 'Publish to PyPI (uncheck for dry run)'
dry_run:
description: 'Dry run (do not publish to PyPi)'
required: false
type: boolean
default: true
dev_release:
description: 'Development release (DEV_RELEASE=1)'
required: false
type: boolean
default: false

permissions:
contents: read
Expand All @@ -29,7 +29,7 @@ jobs:
- uses: ./.github/actions/build-docs

deploy_documentation:
if: ${{ github.event_name == 'push' || inputs.publish }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about removing that: github.event_name == 'push'

I added it because these steps weren't getting triggered because the inputs were not defined when it's a push (vs when it's a manual trigger).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not defined will !inputs.dry_run evaluate to true?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes for pushes the !inputs.dry_run would evaluate to true so it defaults to publish run, unlike previous condition inputs.publish which defaults to dry run.

I did a push-triggered run to verify it:
https://github.com/ml-explore/mlx/actions/runs/21111546178
(it ran the deploy_documentation job, unlike the dry run that did not.)

It is still possible that another pitfall would cause the push-triggered publish to fail, but when that happens I think we can just do a manually-triggered publish and fix it later.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it thanks for clarifying!

if: ${{ !inputs.dry_run }}
needs: build_documentation
permissions:
pages: write
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
permissions:
id-token: write
environment:
name: pypi
name: ${{ inputs.dry_run && 'dry-run' || 'pypi' }}
url: https://pypi.org/p/mlx
steps:
- uses: actions/download-artifact@v7
Expand All @@ -177,7 +177,7 @@ jobs:
- name: Display structure of downloaded files
run: du -ah dist
- name: Publish package distributions to PyPI
if: ${{ github.event_name == 'push' || inputs.publish }}
if: ${{ !inputs.dry_run }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/
Expand All @@ -189,7 +189,7 @@ jobs:
permissions:
id-token: write
environment:
name: pypi
name: ${{ inputs.dry_run && 'dry-run' || 'pypi' }}
url: https://pypi.org/p/mlx-cuda
steps:
- uses: actions/download-artifact@v7
Expand All @@ -200,7 +200,7 @@ jobs:
- name: Display structure of downloaded files
run: du -ah dist
- name: Publish package distributions to PyPI
if: ${{ github.event_name == 'push' || inputs.publish }}
if: ${{ !inputs.dry_run }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/
Expand All @@ -212,7 +212,7 @@ jobs:
permissions:
id-token: write
environment:
name: pypi
name: ${{ inputs.dry_run && 'dry-run' || 'pypi' }}
url: https://pypi.org/p/mlx-cpu
steps:
- uses: actions/download-artifact@v7
Expand All @@ -223,7 +223,7 @@ jobs:
- name: Display structure of downloaded files
run: du -ah dist
- name: Publish package distributions to PyPI
if: ${{ github.event_name == 'push' || inputs.publish }}
if: ${{ !inputs.dry_run }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/
Expand All @@ -235,7 +235,7 @@ jobs:
permissions:
id-token: write
environment:
name: pypi
name: ${{ inputs.dry_run && 'dry-run' || 'pypi' }}
url: https://pypi.org/p/mlx-metal
steps:
- uses: actions/download-artifact@v7
Expand All @@ -245,7 +245,7 @@ jobs:
- name: Display structure of downloaded files
run: du -ah dist
- name: Publish package distributions to PyPI
if: ${{ github.event_name == 'push' || inputs.publish }}
if: ${{ !inputs.dry_run }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/
Loading