Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
239 changes: 0 additions & 239 deletions .github/workflows/_build.yml

This file was deleted.

77 changes: 41 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,57 @@
name: Build wheels
name: Build package artifacts

on:
workflow_dispatch:
inputs:
runs-on:
description: "The runner to use for the build"
required: true
type: string
default: ubuntu-22.04
python-version:
description: "The Python version to use for the build"
required: true
type: string
cuda-version:
description: "The CUDA version to use for the build"
required: true
type: string
torch-version:
description: "The PyTorch version to use for the build"
required: true
type: string
cxx11_abi:
description: "Enable torch flag C++11 ABI (TRUE/FALSE)"
required: true
required: false
type: string
default: "3.10"
upload-to-release:
description: "Upload wheel to this release"
description: "Upload artifacts to this release"
required: false
type: boolean
default: false
release-version:
description: "Upload wheel to this release"
required: false
type: string
arch:
description: "Target a single compute capability. Leave empty to use project default"
description: "Release tag to upload artifacts to"
required: false
type: string

jobs:
build-wheels:
uses: ./.github/workflows/_build.yml
with:
runs-on: ${{ inputs.runs-on }}
python-version: ${{ inputs.python-version }}
cuda-version: ${{ inputs.cuda-version }}
torch-version: ${{ inputs.torch-version }}
cxx11_abi: ${{ inputs.cxx11_abi }}
upload-to-release: ${{ inputs.upload-to-release }}
release-version: ${{ inputs.release-version }}
arch: ${{ inputs.arch }}
build-package:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.release-version || github.ref }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build

- name: Build sdist and wheel
run: python -m build

- name: List built artifacts
run: ls -l dist

- name: Upload workflow artifacts
uses: actions/upload-artifact@v4
with:
name: package-artifacts
path: dist/*

- name: Upload release assets
if: inputs.upload-to-release && inputs.release-version != ''
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.release-version }}
files: dist/*
Comment on lines +52 to +57
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The condition inputs.release-version != '' can behave unexpectedly if the input is unset (GitHub Actions inputs can be null depending on the trigger), which may allow this step to run with an empty/invalid tag_name. Prefer a truthiness check such as if: inputs.upload-to-release && inputs.release-version (or explicitly guard both != '' and != null) to ensure a valid tag is always provided when uploading release assets.

Copilot uses AI. Check for mistakes.
11 changes: 4 additions & 7 deletions .github/workflows/manual_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,12 @@ jobs:

- name: Install dependencies
run: |
pip install ninja packaging wheel twine
pip install setuptools==75.8.0
pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pip install --upgrade pip
pip install build twine

- name: Build core package
env:
FLASH_SPARSE_ATTENTION_SKIP_CUDA_BUILD: "TRUE"
- name: Build package artifacts
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The manual publish workflow also removed FLASH_SPARSE_ATTENTION_SKIP_CUDA_BUILD: \"TRUE\" that previously prevented CUDA compilation during packaging. If the project can optionally build CUDA extensions, this change can break manual publishing on non-CUDA runners. Restore the env var (or otherwise ensure python -m build produces CPU-only artifacts) to keep manual releases functional.

Suggested change
- name: Build package artifacts
- name: Build package artifacts
env:
FLASH_SPARSE_ATTENTION_SKIP_CUDA_BUILD: "TRUE"

Copilot uses AI. Check for mistakes.
run: |
python setup.py sdist --dist-dir=dist
python -m build
ls -l dist

- name: Deploy
Expand Down
Loading
Loading