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
54 changes: 54 additions & 0 deletions .github/workflows/manual_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Manual publish to PyPI

on:
workflow_dispatch:
inputs:
tag:
description: Git tag to publish
required: true
type: string
python-version:
description: Python version to use for build
required: false
default: '3.10'
type: string

jobs:
publish_package:
name: Publish package
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}

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

- 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

- name: Build core package
env:
FLASH_DMATTN_SKIP_CUDA_BUILD: "TRUE"
run: |
python setup.py sdist --dist-dir=dist
ls -l dist

- name: Deploy
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
if [ -z "$TWINE_PASSWORD" ]; then
echo "::error::PYPI_API_TOKEN secret not set; aborting publish."; exit 1
fi
Comment on lines +51 to +53
Copy link

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

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

[nitpick] The secret validation logic should be moved to an earlier step to fail fast before performing expensive build operations. Consider adding a separate validation step before the build step.

Copilot uses AI. Check for mistakes.
python -m twine upload dist/*