Skip to content

Mac ARM Release Dependencies with Nightly PyTorch #10

Mac ARM Release Dependencies with Nightly PyTorch

Mac ARM Release Dependencies with Nightly PyTorch #10

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: |
tar -czf mac_arm_python_env.tar.gz packaged_env
- name: Verify package contents and size
run: |
echo "Package size:"
du -sh mac_arm_python_env.tar.gz
echo "Contents of the package:"
tar -tvf mac_arm_python_env.tar.gz | sort -k 5 -n | tail -n 20
echo "Total number of files:"
tar -tvf mac_arm_python_env.tar.gz | wc -l
echo "Size of packaged_env directory before compression:"
du -sh packaged_env
echo "Largest directories in packaged_env:"
du -sh packaged_env/* | sort -hr | head -n 10
- name: Get current date
id: date
run: echo "date=$(date +'%Y%m%d')" >> $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: "mac_arm_python_env.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}