Skip to content
Merged
Show file tree
Hide file tree
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
110 changes: 110 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Release

# Publishes the pure-Python nvsubquadratic wheel + sdist to PyPI on a
# `vX.Y.Z` tag push (or manual dispatch with an existing tag).
#
# Routing:
# - prerelease tags containing "rc" (e.g. v0.1.0rc1) -> TestPyPI
# - final tags (e.g. v0.1.0) -> PyPI
#
# Auth is OIDC "trusted publisher" — no API token secret. One-time setup
# required before the first run:
# 1. On pypi.org and test.pypi.org, add a trusted publisher for this repo
# pointing at workflow `release.yml` and the matching environment below.
# 2. Create GitHub environments named `pypi` and `testpypi`
# (Settings -> Environments).
# The package version is read from the VERSION file; the build job fails fast
# if the tag does not match it, so bump VERSION before tagging.

on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
tag:
description: "Existing tag to build & publish (e.g. v0.1.0 or v0.1.0rc1)"
required: true

permissions:
contents: read

concurrency:
group: release-${{ github.event.inputs.tag || github.ref_name }}
cancel-in-progress: false

jobs:
build:
name: Build sdist + wheel
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag || github.ref }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Verify tag matches VERSION
run: |
TAG="${{ github.event.inputs.tag || github.ref_name }}"
TAG_VER="${TAG#v}"
FILE_VER="$(tr -d '[:space:]' < VERSION)"
if [ "$TAG_VER" != "$FILE_VER" ]; then
echo "::error::Tag $TAG (version $TAG_VER) does not match VERSION file ($FILE_VER). Bump VERSION before tagging."
exit 1
fi
echo "Tag $TAG matches VERSION $FILE_VER"

- name: Build
run: |
python -m pip install --upgrade pip build twine
python -m build
twine check dist/*

- name: Upload dist artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

publish-testpypi:
name: Publish to TestPyPI (prerelease)
needs: build
if: contains(github.event.inputs.tag || github.ref_name, 'rc')
runs-on: ubuntu-latest
environment: testpypi
permissions:
id-token: write
steps:
- name: Download dist
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

publish-pypi:
name: Publish to PyPI (final release)
needs: build
if: ${{ !contains(github.event.inputs.tag || github.ref_name, 'rc') }}
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- name: Download dist
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ nvSubquadratic consolidates efforts from across NVIDIA Research teams (nvResearc

**Requirements**:

- CUDA-compatible NVIDIA GPU (Ampere or Hopper architecture)
- CUDA-compatible NVIDIA GPU (Ampere or newer)
- CUDA Toolkit 12.0 or higher
- Python 3.11 or higher

Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Apptainer, conda, venv) see the project [README](https://github.com/NVIDIA-BioNe

## Requirements

- CUDA-compatible NVIDIA GPU (Ampere or Hopper architecture)
- CUDA-compatible NVIDIA GPU (Ampere or newer)
- CUDA Toolkit 12.0 or higher
- Python 3.11 or higher

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ To enable the optional fused RMSNorm kernel on Hopper / Blackwell GPUs:
Requirements
------------

- CUDA-compatible NVIDIA GPU (Ampere or Hopper architecture)
- CUDA-compatible NVIDIA GPU (Ampere or newer)
- CUDA Toolkit 12.0 or higher
- Python 3.11 or higher

Expand Down
Loading