Skip to content

Mac ARM Release Dependencies with Nightly PyTorch #14

Mac ARM Release Dependencies with Nightly PyTorch

Mac ARM Release Dependencies with Nightly PyTorch #14

name: "Mac ARM Release Dependencies with Nightly PyTorch"
on:
workflow_dispatch:
inputs:
python_minor:
description: 'python minor version'
required: true
type: string
default: "12"
extra_dependencies:
description: 'extra dependencies'
required: false
type: string
default: "\"numpy<2\""
jobs:
build_and_release_dependencies:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.${{ inputs.python_minor }}'
- name: Create virtual environment
run: |
python -m venv packaged_env
source packaged_env/bin/activate
python -m pip install --upgrade pip
- name: Install PyTorch nightly
run: |
source packaged_env/bin/activate
pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu
- name: Fetch and install ComfyUI requirements
run: |
source packaged_env/bin/activate
curl -o requirements.txt https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/requirements.txt
pip install ${{ inputs.extra_dependencies }} -r requirements.txt
- name: Verify PyTorch installation
run: |
source packaged_env/bin/activate
python -c "import torch; print(f'PyTorch version: {torch.__version__}')"
python -c "import torch; print(f'PyTorch installation directory: {torch.__file__}')"
python -c "import torchvision; print(f'torchvision version: {torchvision.__version__}')"
python -c "import torchaudio; print(f'torchaudio version: {torchaudio.__version__}')"
- name: Package environment
run: |
source packaged_env/bin/activate
pip install pyinstaller
git clone https://github.com/comfyanonymous/ComfyUI --depth 1
cp ComfyUI.spec ComfyUI/
cd ComfyUI
pyinstaller ComfyUI.spec
tar -czf mac_arm_python_env.tar.gz dist/ComfyUI
- name: Get current date
id: date
run: echo "datetime=$(date +'%Y-%m-%d-%H%M%S')" >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: mac-arm-deps-py3.${{ inputs.python_minor }}-${{ steps.date.outputs.date }}
name: Mac ARM Dependencies Python 3.${{ inputs.python_minor }} (${{ steps.date.outputs.date }})
body: |
Mac ARM dependencies with Nightly PyTorch
Build Date: ${{ steps.date.outputs.date }}
Includes:
- Python 3.${{ inputs.python_minor }} virtual environment
- PyTorch (Nightly build)
- ComfyUI requirements
draft: false
prerelease: true
artifacts: "ComfyUI/mac_arm_python_env.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}