Skip to content

fix up ci

fix up ci #96

Workflow file for this run

# Publish sdist to TestPyPI + wheels to GitHub Release.
#
# Runs on push to kdidi/jit_and_precompiled or manual trigger.
# Safe to run on every push: TestPyPI rejects duplicate versions,
# so the upload step is a no-op if the version already exists.
#
# PyPI/TestPyPI rejects wheel filenames with "+" local version segments
# (e.g. +cu12torch2.5), so wheels are distributed via GitHub Releases
# and installed with: pip install tmol --find-links <release-url>
#
# Three separate jobs so you can RE-RUN just the upload if it fails
# without rebuilding wheels/sdist.
name: Publish to TestPyPI
on:
push:
branches: [main, "kdidi/**"]
workflow_dispatch:
jobs:
# ── Job 1: Build wheels ─────────────────────────────────────────────
build_wheels:
name: Build Wheel (${{ matrix.torch-version }}, abi=${{ matrix.cxx11_abi }}, ${{ matrix.arch }})
strategy:
fail-fast: false
matrix:
include:
# ═══════════════════════════════════════════════════════════════
# Python 3.12 (cp312) — NGC 25.06+ containers
# ═══════════════════════════════════════════════════════════════
# ── x86_64 ABI=TRUE (cp312) ──
- container-image: nvcr.io/nvidia/pytorch:25.06-py3
torch-version: "2.8"
cxx11_abi: "TRUE"
runs-on: ubuntu-22.04
arch: x86_64
- container-image: nvcr.io/nvidia/pytorch:25.10-py3
torch-version: "2.9"
cxx11_abi: "TRUE"
runs-on: ubuntu-22.04
arch: x86_64
- container-image: nvcr.io/nvidia/pytorch:26.01-py3
torch-version: "2.10"
cxx11_abi: "TRUE"
runs-on: ubuntu-22.04
arch: x86_64
# ── x86_64 ABI=FALSE (cp312) ──
- container-image: nvcr.io/nvidia/pytorch:25.06-py3
torch-version: "2.8"
cxx11_abi: "FALSE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
- container-image: nvcr.io/nvidia/pytorch:25.06-py3
torch-version: "2.9"
cxx11_abi: "FALSE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
- container-image: nvcr.io/nvidia/pytorch:25.06-py3
torch-version: "2.10"
cxx11_abi: "FALSE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
# ── ARM64 ABI=TRUE (cp312) ──
- container-image: nvcr.io/nvidia/pytorch:25.06-py3
torch-version: "2.8"
cxx11_abi: "TRUE"
runs-on: ubuntu-24.04-arm
arch: aarch64
- container-image: nvcr.io/nvidia/pytorch:25.10-py3
torch-version: "2.9"
cxx11_abi: "TRUE"
runs-on: ubuntu-24.04-arm
arch: aarch64
- container-image: nvcr.io/nvidia/pytorch:26.01-py3
torch-version: "2.10"
cxx11_abi: "TRUE"
runs-on: ubuntu-24.04-arm
arch: aarch64
# ═══════════════════════════════════════════════════════════════
# Python 3.10 (cp310) — NGC 24.10 container (Python 3.10, CUDA 12.6)
# Reinstalls target PyTorch via pip into the container.
# ═══════════════════════════════════════════════════════════════
# ── x86_64 ABI=TRUE (cp310) ──
- container-image: nvcr.io/nvidia/pytorch:24.10-py3
torch-version: "2.8"
cxx11_abi: "TRUE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
python-version: "310"
- container-image: nvcr.io/nvidia/pytorch:24.10-py3
torch-version: "2.9"
cxx11_abi: "TRUE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
python-version: "310"
- container-image: nvcr.io/nvidia/pytorch:24.10-py3
torch-version: "2.10"
cxx11_abi: "TRUE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
python-version: "310"
# ── x86_64 ABI=FALSE (cp310) ──
- container-image: nvcr.io/nvidia/pytorch:24.10-py3
torch-version: "2.8"
cxx11_abi: "FALSE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
python-version: "310"
- container-image: nvcr.io/nvidia/pytorch:24.10-py3
torch-version: "2.9"
cxx11_abi: "FALSE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
python-version: "310"
- container-image: nvcr.io/nvidia/pytorch:24.10-py3
torch-version: "2.10"
cxx11_abi: "FALSE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
python-version: "310"
# ARM64 cp310: removed — pip doesn't publish ARM CUDA wheels,
# so we can't pip-install torch into the 24.10 container for ARM.
# ARM cp312 builds use NGC containers directly (no pip reinstall).
# ═══════════════════════════════════════════════════════════════
# Python 3.11 (cp311) — NGC 24.10 container + pip torch/cu126
# Python 3.11 is provisioned inside the container at build time.
# ═══════════════════════════════════════════════════════════════
# ── x86_64 ABI=TRUE (cp311) ──
- container-image: nvcr.io/nvidia/pytorch:24.10-py3
torch-version: "2.8"
cxx11_abi: "TRUE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
python-version: "311"
- container-image: nvcr.io/nvidia/pytorch:24.10-py3
torch-version: "2.9"
cxx11_abi: "TRUE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
python-version: "311"
- container-image: nvcr.io/nvidia/pytorch:24.10-py3
torch-version: "2.10"
cxx11_abi: "TRUE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
python-version: "311"
# ── x86_64 ABI=FALSE (cp311) ──
- container-image: nvcr.io/nvidia/pytorch:24.10-py3
torch-version: "2.8"
cxx11_abi: "FALSE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
python-version: "311"
- container-image: nvcr.io/nvidia/pytorch:24.10-py3
torch-version: "2.9"
cxx11_abi: "FALSE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
python-version: "311"
- container-image: nvcr.io/nvidia/pytorch:24.10-py3
torch-version: "2.10"
cxx11_abi: "FALSE"
pip-torch-cuda-url: "https://download.pytorch.org/whl/cu126"
runs-on: ubuntu-22.04
arch: x86_64
python-version: "311"
uses: ./.github/workflows/_build_wheel.yml
with:
runs-on: ${{ matrix.runs-on }}
container-image: ${{ matrix.container-image }}
torch-version: ${{ matrix.torch-version }}
cxx11_abi: ${{ matrix.cxx11_abi }}
python-version: ${{ matrix.python-version || '312' }}
pip-torch-cuda-url: ${{ matrix.pip-torch-cuda-url || '' }}
# ── Job 2: Build sdist ──────────────────────────────────────────────
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
pip install "scikit-build-core>=0.10" ninja "packaging>=24.2" "pybind11>=2.12" build
pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Build sdist
run: python -m build --sdist --no-isolation --outdir dist
- name: Log sdist
run: ls -lh dist/
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
# ── Job 3: Upload ──────────────────────────────────────────────────
#
# sdist → TestPyPI (no local version segment, PyPI accepts it)
# wheels → GitHub Release (local version +cu... is fine here)
#
# If this job fails you can RE-RUN just this job from the Actions UI.
upload:
name: Upload sdist to TestPyPI + wheels to GitHub Release
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install twine
run: pip install twine
# ── Download artifacts ──
- name: Download sdist artifact
uses: actions/download-artifact@v4
with:
name: sdist
path: dist/
- name: Download wheel artifacts
uses: actions/download-artifact@v4
with:
path: wheels/
pattern: wheel-*
merge-multiple: true
- name: List all packages
run: |
echo "=== sdist ==="
ls -lh dist/
echo "=== wheels ==="
ls -lh wheels/ || echo "(no wheels)"
# ── Upload sdist to TestPyPI ──
- name: Upload sdist to TestPyPI
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: python -m twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*
# ── Upload wheels to a GitHub Release ──
- name: Determine version from sdist filename
id: version
run: |
SDIST=$(ls dist/*.tar.gz | head -1 | xargs basename)
VERSION=$(echo "$SDIST" | sed 's/^tmol-//;s/\.tar\.gz$//')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Detected version: $VERSION"
- name: Create or get GitHub Release
id: release
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ steps.version.outputs.version }}"
name: "v${{ steps.version.outputs.version }}"
draft: false
prerelease: true
generate_release_notes: false
files: wheels/*.whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Uncomment for real PyPI releases (sdist only):
# - name: Upload sdist to PyPI
# env:
# TWINE_USERNAME: "__token__"
# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
# run: python -m twine upload dist/*