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
60 changes: 32 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,30 @@ on:
- 'v*'
workflow_dispatch:
inputs:
publish:
description: 'Publish to PyPI (uncheck for dry run)'
required: false
type: boolean
default: true
dev_release:
description: "Do a dev release or regular release"
required: true
default: "false"
description: 'Development release (DEV_RELEASE=1)'
required: false
type: boolean
default: false

permissions:
contents: read

jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Set publishing variables
run: echo "Publishing setup complete"

build_documentation:
if: github.repository == 'ml-explore/mlx'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/build-docs

deploy_documentation:
if: inputs.publish
needs: build_documentation
permissions:
pages: write
Expand All @@ -51,7 +52,7 @@ jobs:
runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-22.04' || 'ubuntu-22.04-arm' }}
env:
PYPI_RELEASE: 1
DEV_RELEASE: ${{ github.event.inputs.dev_release == 'true' && 1 || 0 }}
DEV_RELEASE: ${{ inputs.dev_release && 1 || 0 }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-linux
Expand All @@ -77,7 +78,7 @@ jobs:
name: mlx-cpu-${{ matrix.arch }}
path: wheelhouse/mlx_cpu-*.whl
if-no-files-found: error

build_mac_release:
if: github.repository == 'ml-explore/mlx'
strategy:
Expand All @@ -86,8 +87,7 @@ jobs:
runs-on: [self-hosted, macos]
env:
PYPI_RELEASE: 1
DEV_RELEASE: ${{ github.event.inputs.dev_release == 'true' && 1 || 0 }}

DEV_RELEASE: ${{ inputs.dev_release && 1 || 0 }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-macos
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-22-large' || 'ubuntu-22-large-arm' }}
env:
PYPI_RELEASE: 1
DEV_RELEASE: ${{ github.event.inputs.dev_release == 'true' && 1 || 0 }}
DEV_RELEASE: ${{ inputs.dev_release && 1 || 0 }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-linux
Expand All @@ -162,11 +162,11 @@ jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: [setup, build_linux_release, build_mac_release]
needs: [build_linux_release, build_mac_release]
permissions:
id-token: write
environment:
name: pypi
name: ${{ inputs.publish && 'pypi' || '' }}
url: https://pypi.org/p/mlx
steps:
- uses: actions/download-artifact@v7
Expand All @@ -180,41 +180,43 @@ jobs:
merge-multiple: true
path: dist
- name: Display structure of downloaded files
run: ls -R dist
run: du -ah dist
- name: Publish package distributions to PyPI
if: inputs.publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/

pypi-publish-cuda:
name: Upload CUDA release to PyPI
runs-on: ubuntu-latest
needs: [setup, build_cuda_release]
needs: [build_cuda_release]
permissions:
id-token: write
environment:
name: pypi
name: ${{ inputs.publish && 'pypi' || '' }}
url: https://pypi.org/p/mlx-cuda
steps:
- uses: actions/download-artifact@v7
with:
name: mlx-cuda-*
path: dist
- name: Display structure of downloaded files
run: ls -R dist
run: du -ah dist
- name: Publish package distributions to PyPI
if: inputs.publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/

pypi-publish-cpu:
name: Upload CPU release to PyPI
runs-on: ubuntu-latest
needs: [setup, build_linux_release]
needs: [build_linux_release]
permissions:
id-token: write
environment:
name: pypi
name: ${{ inputs.publish && 'pypi' || '' }}
url: https://pypi.org/p/mlx-cpu
steps:
- uses: actions/download-artifact@v7
Expand All @@ -223,29 +225,31 @@ jobs:
merge-multiple: true
path: dist
- name: Display structure of downloaded files
run: ls -R dist
run: du -ah dist
- name: Publish package distributions to PyPI
if: inputs.publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/

pypi-publish-metal:
name: Upload Metal release to PyPI
runs-on: ubuntu-latest
needs: [setup, build_mac_release]
needs: [build_mac_release]
permissions:
id-token: write
environment:
name: pypi
name: ${{ inputs.publish && 'pypi' || '' }}
url: https://pypi.org/p/mlx-metal
steps:
- uses: actions/download-artifact@v7
with:
name: mlx-metal
path: dist
- name: Display structure of downloaded files
run: ls -R dist
run: du -ah dist
- name: Publish package distributions to PyPI
if: inputs.publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/
Loading