From 34efe9073b457fbc872ad83f8ea4017b9127e8e5 Mon Sep 17 00:00:00 2001 From: Thiago Maltempi Date: Thu, 22 Oct 2026 14:35:44 -0300 Subject: [PATCH 1/2] GPUZIPy: distribute wheels via GitHub Releases instead of PyPI - Remove the PyPI publish step (and its environment/id-token permission) from the wheels workflow; tagged builds only attach wheels to the GitHub Release. - Fail the release job if the tag doesn't match the setup.py version. - Bump GPUZIPy version to 2.1.0 to match the gpuzipy-v2.1.0 tag. - Notebook/README: install from the release with pip --only-binary gpuzipy --find-links .../expanded_assets/. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/gpuzipy-wheels.yml | 20 ++++++++++++++------ GPUZIPy/README.md | 13 +++++++++---- GPUZIPy/example/GPUZIPy_Example.ipynb | 4 ++-- GPUZIPy/setup.py | 2 +- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/gpuzipy-wheels.yml b/.github/workflows/gpuzipy-wheels.yml index abdeeef..4263a5d 100644 --- a/.github/workflows/gpuzipy-wheels.yml +++ b/.github/workflows/gpuzipy-wheels.yml @@ -2,8 +2,10 @@ name: GPUZIPy wheels # Builds manylinux CUDA 12 wheels for GPUZIPy (no GPU needed to compile). # - Manual run / PRs touching the bindings: build only, wheels kept as workflow artifacts. -# - Tag "gpuzipy-v*" (e.g. gpuzipy-v0.0.1): build, attach to a GitHub Release, publish to PyPI. -# The tag must match the version in GPUZIPy/setup.py. +# - Tag "gpuzipy-v*" (e.g. gpuzipy-v2.1.0): build and attach the wheels to a GitHub Release. +# The tag must match the version in GPUZIPy/setup.py. Users install with: +# pip install gpuzipy --only-binary gpuzipy \ +# --find-links https://github.com/LSC-Unicamp/GPUZIP/releases/expanded_assets/ on: workflow_dispatch: @@ -55,11 +57,19 @@ jobs: if: startsWith(github.ref, 'refs/tags/gpuzipy-v') needs: [wheels, sdist] runs-on: ubuntu-latest - environment: pypi permissions: contents: write # GitHub Release - id-token: write # PyPI trusted publishing steps: + - uses: actions/checkout@v4 + + - name: Check tag matches setup.py version + run: | + version=$(grep -oP '^\s*version="\K[^"]+' GPUZIPy/setup.py) + if [ "gpuzipy-v$version" != "$GITHUB_REF_NAME" ]; then + echo "::error::Tag $GITHUB_REF_NAME does not match setup.py version $version" + exit 1 + fi + - uses: actions/download-artifact@v4 with: path: dist @@ -68,5 +78,3 @@ jobs: - uses: softprops/action-gh-release@v2 with: files: dist/* - - - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/GPUZIPy/README.md b/GPUZIPy/README.md index 41365b2..3547af0 100644 --- a/GPUZIPy/README.md +++ b/GPUZIPy/README.md @@ -13,12 +13,17 @@ Input/output buffers are raw GPU device pointers (e.g. from [CuPy](https://cupy. ## Install -Prebuilt wheels (Linux x86_64, Python 3.10-3.13, CUDA 12, GPUs from Volta/sm_70 to Hopper/sm_90): +Prebuilt wheels (Linux x86_64, Python 3.10-3.13, CUDA 12, GPUs from Volta/sm_70 to Hopper/sm_90) +are attached to the [GitHub Releases](https://github.com/LSC-Unicamp/GPUZIP/releases): ```sh -pip install gpuzipy +pip install gpuzipy --only-binary gpuzipy \ + --find-links https://github.com/LSC-Unicamp/GPUZIP/releases/expanded_assets/gpuzipy-v2.1.0 ``` +pip picks the wheel matching your Python version. `--only-binary` stops it from picking +GitHub's auto-generated source archive listed on the same page. + Only an NVIDIA driver supporting CUDA 12 is needed; nvcomp (Bitcomp), cuZFP and cuSZp are bundled. ### Build from source @@ -53,8 +58,8 @@ With it, results land directly in `GPUZIPy/example/output/` on the host. `.github/workflows/gpuzipy-wheels.yml` builds the wheels with cibuildwheel (config in `pyproject.toml`). Bump `version` in `setup.py`, then push a matching tag, e.g. -`git tag gpuzipy-v0.0.2 && git push origin gpuzipy-v0.0.2`, to publish a GitHub Release and -upload to PyPI. +`git tag gpuzipy-v2.1.1 && git push origin gpuzipy-v2.1.1`, to publish a GitHub Release with +the wheels. Then update the `--find-links` tag above and in the example notebook. ## License diff --git a/GPUZIPy/example/GPUZIPy_Example.ipynb b/GPUZIPy/example/GPUZIPy_Example.ipynb index 3d1e7b7..fc2131c 100644 --- a/GPUZIPy/example/GPUZIPy_Example.ipynb +++ b/GPUZIPy/example/GPUZIPy_Example.ipynb @@ -23,8 +23,8 @@ }, "outputs": [], "source": [ - "# Prebuilt CUDA 12 wheel (Linux x86_64, Python 3.10-3.13): no compilation needed.\n", - "!pip install gpuzipy\n", + "# Prebuilt CUDA 12 wheel from the GitHub Release (Linux x86_64, Python 3.10-3.13): no compilation needed.\n", + "!pip install gpuzipy --only-binary gpuzipy --find-links https://github.com/LSC-Unicamp/GPUZIP/releases/expanded_assets/gpuzipy-v2.1.0\n", "\n", "# Alternatively, build from source (~7 min on Colab):\n", "# !git clone https://github.com/LSC-Unicamp/GPUZIP.git && cd GPUZIP/GPUZIPy && pip install ." diff --git a/GPUZIPy/setup.py b/GPUZIPy/setup.py index 1ecd18b..c991aaf 100644 --- a/GPUZIPy/setup.py +++ b/GPUZIPy/setup.py @@ -74,7 +74,7 @@ def make_release_tree(self, base_dir, files): # logic and declaration, and simpler if you include description/version in a file. setup( name="gpuzipy", - version="0.0.1", + version="2.1.0", author="Thiago Maltempi", author_email="maltempi@ic.unicamp.br", description="Python bindings for GPUZIP's GPU compression layer (Bitcomp, cuZFP, cuSZp).", From 577f1b712b263d741dac514caa272c22b19835f5 Mon Sep 17 00:00:00 2001 From: Thiago Maltempi Date: Thu, 22 Oct 2026 14:37:35 -0300 Subject: [PATCH 2/2] Release workflow: trigger on plain version tags, ship Python + C++ - Rename gpuzipy-wheels.yml -> release.yml; run on tags like 2.1.1 ([0-9]+.[0-9]+.[0-9]+) instead of gpuzipy-v*. - Check the tag matches GPUZIPy/setup.py before building. - Add a C++ artifact (gpuzip--cpp.tar.gz: header-only src/, standalone example, LICENSE, README) to the same GitHub Release, with release notes covering both install paths. - Point the notebook/README --find-links at the 2.1.0 release. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/gpuzipy-wheels.yml | 80 ----------------- .github/workflows/release.yml | 123 ++++++++++++++++++++++++++ GPUZIPy/README.md | 11 +-- GPUZIPy/example/GPUZIPy_Example.ipynb | 2 +- GPUZIPy/pyproject.toml | 2 +- 5 files changed, 131 insertions(+), 87 deletions(-) delete mode 100644 .github/workflows/gpuzipy-wheels.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/gpuzipy-wheels.yml b/.github/workflows/gpuzipy-wheels.yml deleted file mode 100644 index 4263a5d..0000000 --- a/.github/workflows/gpuzipy-wheels.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: GPUZIPy wheels - -# Builds manylinux CUDA 12 wheels for GPUZIPy (no GPU needed to compile). -# - Manual run / PRs touching the bindings: build only, wheels kept as workflow artifacts. -# - Tag "gpuzipy-v*" (e.g. gpuzipy-v2.1.0): build and attach the wheels to a GitHub Release. -# The tag must match the version in GPUZIPy/setup.py. Users install with: -# pip install gpuzipy --only-binary gpuzipy \ -# --find-links https://github.com/LSC-Unicamp/GPUZIP/releases/expanded_assets/ - -on: - workflow_dispatch: - pull_request: - paths: - - "GPUZIPy/**" - - "src/Compressor/**" - - ".github/workflows/gpuzipy-wheels.yml" - push: - tags: - - "gpuzipy-v*" - -jobs: - wheels: - name: Wheel ${{ matrix.python }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python: [cp310, cp311, cp312, cp313] - steps: - - uses: actions/checkout@v4 - - # cibuildwheel copies the whole repo into the container; GPUZIPy's CMake build - # reads ../src/Compressor from there. - - uses: pypa/cibuildwheel@v2.23.3 - with: - package-dir: GPUZIPy - output-dir: wheelhouse - env: - CIBW_BUILD: ${{ matrix.python }}-manylinux_x86_64 - - - uses: actions/upload-artifact@v4 - with: - name: wheel-${{ matrix.python }} - path: wheelhouse/*.whl - - sdist: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: pipx run build --sdist --outdir dist GPUZIPy - - uses: actions/upload-artifact@v4 - with: - name: sdist - path: dist/*.tar.gz - - release: - if: startsWith(github.ref, 'refs/tags/gpuzipy-v') - needs: [wheels, sdist] - runs-on: ubuntu-latest - permissions: - contents: write # GitHub Release - steps: - - uses: actions/checkout@v4 - - - name: Check tag matches setup.py version - run: | - version=$(grep -oP '^\s*version="\K[^"]+' GPUZIPy/setup.py) - if [ "gpuzipy-v$version" != "$GITHUB_REF_NAME" ]; then - echo "::error::Tag $GITHUB_REF_NAME does not match setup.py version $version" - exit 1 - fi - - - uses: actions/download-artifact@v4 - with: - path: dist - merge-multiple: true - - - uses: softprops/action-gh-release@v2 - with: - files: dist/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..eb1a397 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,123 @@ +name: Release + +# One GitHub Release per version tag (e.g. 2.1.1), covering both GPUZIP flavours: +# - Python: GPUZIPy manylinux CUDA 12 wheels (no GPU needed to compile) + sdist. +# - C++: the header-only library (src/) and the standalone example, as a tarball. +# PRs touching the Python bindings and manual runs only build; wheels are kept as +# workflow artifacts. +# +# To release: set `version` in GPUZIPy/setup.py, merge, then +# git tag 2.1.1 && git push origin 2.1.1 +# The tag must match the setup.py version. Python users install with: +# pip install gpuzipy --only-binary gpuzipy \ +# --find-links https://github.com/LSC-Unicamp/GPUZIP/releases/expanded_assets/ + +on: + workflow_dispatch: + pull_request: + paths: + - "GPUZIPy/**" + - "src/Compressor/**" + - ".github/workflows/release.yml" + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" + +jobs: + check-version: + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check tag matches GPUZIPy/setup.py version + run: | + version=$(grep -oP '^\s*version="\K[^"]+' GPUZIPy/setup.py) + if [ "$version" != "$GITHUB_REF_NAME" ]; then + echo "::error::Tag $GITHUB_REF_NAME does not match GPUZIPy/setup.py version $version" + exit 1 + fi + + wheels: + name: Wheel ${{ matrix.python }} + needs: [check-version] + # check-version is skipped on PRs/manual runs; build anyway unless it failed. + if: ${{ !failure() && !cancelled() }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python: [cp310, cp311, cp312, cp313] + steps: + - uses: actions/checkout@v4 + + # cibuildwheel copies the whole repo into the container; GPUZIPy's CMake build + # reads ../src/Compressor from there. + - uses: pypa/cibuildwheel@v2.23.3 + with: + package-dir: GPUZIPy + output-dir: wheelhouse + env: + CIBW_BUILD: ${{ matrix.python }}-manylinux_x86_64 + + - uses: actions/upload-artifact@v4 + with: + name: wheel-${{ matrix.python }} + path: wheelhouse/*.whl + + sdist: + needs: [check-version] + if: ${{ !failure() && !cancelled() }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: pipx run build --sdist --outdir dist GPUZIPy + - uses: actions/upload-artifact@v4 + with: + name: sdist + path: dist/*.tar.gz + + cpp: + needs: [check-version] + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Package header-only C++ library + run: | + mkdir -p dist + git archive --prefix="gpuzip-$GITHUB_REF_NAME/" \ + -o "dist/gpuzip-$GITHUB_REF_NAME-cpp.tar.gz" \ + HEAD src standalone-example LICENSE README.md + - uses: actions/upload-artifact@v4 + with: + name: cpp + path: dist/*.tar.gz + + release: + if: startsWith(github.ref, 'refs/tags/') + needs: [wheels, sdist, cpp] + runs-on: ubuntu-latest + permissions: + contents: write # GitHub Release + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + merge-multiple: true + + - uses: softprops/action-gh-release@v2 + with: + files: dist/* + generate_release_notes: true + body: | + ## Python (GPUZIPy) + Prebuilt CUDA 12 wheels for Linux x86_64, Python 3.10-3.13 (GPUs sm_70 to sm_90): + ```sh + pip install gpuzipy --only-binary gpuzipy \ + --find-links https://github.com/${{ github.repository }}/releases/expanded_assets/${{ github.ref_name }} + ``` + + ## C++ (header-only) + `gpuzip-${{ github.ref_name }}-cpp.tar.gz` contains the library (`src/`) and the + standalone example. Add `src/Compressor/include` and/or `src/Prefetch/include` to + your include path. diff --git a/GPUZIPy/README.md b/GPUZIPy/README.md index 3547af0..643f714 100644 --- a/GPUZIPy/README.md +++ b/GPUZIPy/README.md @@ -18,7 +18,7 @@ are attached to the [GitHub Releases](https://github.com/LSC-Unicamp/GPUZIP/rele ```sh pip install gpuzipy --only-binary gpuzipy \ - --find-links https://github.com/LSC-Unicamp/GPUZIP/releases/expanded_assets/gpuzipy-v2.1.0 + --find-links https://github.com/LSC-Unicamp/GPUZIP/releases/expanded_assets/2.1.0 ``` pip picks the wheel matching your Python version. `--only-binary` stops it from picking @@ -56,10 +56,11 @@ With it, results land directly in `GPUZIPy/example/output/` on the host. ## Releasing wheels -`.github/workflows/gpuzipy-wheels.yml` builds the wheels with cibuildwheel (config in -`pyproject.toml`). Bump `version` in `setup.py`, then push a matching tag, e.g. -`git tag gpuzipy-v2.1.1 && git push origin gpuzipy-v2.1.1`, to publish a GitHub Release with -the wheels. Then update the `--find-links` tag above and in the example notebook. +`.github/workflows/release.yml` builds the wheels with cibuildwheel (config in +`pyproject.toml`). Bump `version` in `setup.py`, merge, then push a matching tag, e.g. +`git tag 2.1.1 && git push origin 2.1.1`. This creates one GitHub Release with the Python +wheels and the C++ header-only package. Then update the `--find-links` tag above and in the +example notebook. ## License diff --git a/GPUZIPy/example/GPUZIPy_Example.ipynb b/GPUZIPy/example/GPUZIPy_Example.ipynb index fc2131c..2da1d8e 100644 --- a/GPUZIPy/example/GPUZIPy_Example.ipynb +++ b/GPUZIPy/example/GPUZIPy_Example.ipynb @@ -24,7 +24,7 @@ "outputs": [], "source": [ "# Prebuilt CUDA 12 wheel from the GitHub Release (Linux x86_64, Python 3.10-3.13): no compilation needed.\n", - "!pip install gpuzipy --only-binary gpuzipy --find-links https://github.com/LSC-Unicamp/GPUZIP/releases/expanded_assets/gpuzipy-v2.1.0\n", + "!pip install gpuzipy --only-binary gpuzipy --find-links https://github.com/LSC-Unicamp/GPUZIP/releases/expanded_assets/2.1.0\n", "\n", "# Alternatively, build from source (~7 min on Colab):\n", "# !git clone https://github.com/LSC-Unicamp/GPUZIP.git && cd GPUZIP/GPUZIPy && pip install ." diff --git a/GPUZIPy/pyproject.toml b/GPUZIPy/pyproject.toml index f3627be..9164b61 100644 --- a/GPUZIPy/pyproject.toml +++ b/GPUZIPy/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=64", "wheel", "cmake>=3.22", "pybind11>=2.11"] build-backend = "setuptools.build_meta" # Release wheels: built with cibuildwheel inside manylinux_2_28 (AlmaLinux 8) with the -# CUDA toolkit installed. See .github/workflows/gpuzipy-wheels.yml. +# CUDA toolkit installed. See .github/workflows/release.yml. [tool.cibuildwheel] build = "cp310-* cp311-* cp312-* cp313-*" skip = "*-musllinux_*"