Skip to content

Add CPU wheel build workflows for Linux & Windows#111

Open
SpaceTimee wants to merge 2 commits intoJamePeng:mainfrom
SpaceTimee:main
Open

Add CPU wheel build workflows for Linux & Windows#111
SpaceTimee wants to merge 2 commits intoJamePeng:mainfrom
SpaceTimee:main

Conversation

@SpaceTimee
Copy link
Copy Markdown

Add GitHub Actions workflows for CPU-only Python wheels.

Copilot AI review requested due to automatic review settings April 14, 2026 07:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds GitHub Actions workflows to build and publish CPU-only Python wheels on Windows and Linux.

Changes:

  • Introduce a Windows CPU wheel build workflow using uv + python -m build.
  • Introduce a Linux CPU wheel build workflow using uv build with OpenBLAS enabled.
  • Add wheel renaming to append +cpu.<avxver> local version metadata and publish artifacts via GitHub Releases.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/build-wheels-cpu-win.yml New workflow to build CPU-only wheels on Windows across a Python-version matrix and publish to a release.
.github/workflows/build-wheels-cpu-linux.yml New workflow to build CPU-only wheels on Linux (OpenBLAS) across a Python-version matrix and publish to a release.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +100 to +117
- name: Get Current Date
id: get-date
run: |
$currentDate = Get-Date -UFormat "%Y%m%d"
Write-Output "BUILD_DATE=$currentDate" >> $env:GITHUB_ENV

- name: Create Git Tag
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag "v${{ env.TAG_VERSION }}-cpu-${{ env.AVXVER }}-win-${{ env.BUILD_DATE }}"
git push origin "v${{ env.TAG_VERSION }}-cpu-${{ env.AVXVER }}-win-${{ env.BUILD_DATE }}"

- name: Create Release
if: always() && env.TAG_VERSION != ''
uses: softprops/action-gh-release@v2
with:
files: dist/*
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The Create Git Tag step will deterministically conflict in the current matrix setup: each Python-version job tries to create and push the exact same tag (v<TAG_VERSION>-cpu-<AVXVER>-win-<BUILD_DATE>). The first job to push will win; subsequent jobs will fail (and a workflow re-run on the same day/version will also fail because the tag already exists). Prefer removing the manual git tag/git push and letting softprops/action-gh-release manage the tag, or gate tag/release creation to a single matrix entry and use artifacts + a separate release job to publish all wheels under one tag/release.

Suggested change
- name: Get Current Date
id: get-date
run: |
$currentDate = Get-Date -UFormat "%Y%m%d"
Write-Output "BUILD_DATE=$currentDate" >> $env:GITHUB_ENV
- name: Create Git Tag
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag "v${{ env.TAG_VERSION }}-cpu-${{ env.AVXVER }}-win-${{ env.BUILD_DATE }}"
git push origin "v${{ env.TAG_VERSION }}-cpu-${{ env.AVXVER }}-win-${{ env.BUILD_DATE }}"
- name: Create Release
if: always() && env.TAG_VERSION != ''
uses: softprops/action-gh-release@v2
with:
files: dist/*
- name: Upload Built Wheels
if: always() && env.TAG_VERSION != ''
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.pyver }}-${{ matrix.releasetag }}
path: dist/*
if-no-files-found: error
release:
name: Create Windows CPU Release
needs: build_wheels
runs-on: windows-2022
defaults:
run:
shell: pwsh
env:
AVXVER: Basic
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- name: Download Built Wheels
uses: actions/download-artifact@v4
with:
path: dist
pattern: wheels-*
merge-multiple: true
- name: Get Package Version
run: |
$version = (Select-String -Path "setup.py" -Pattern 'version\s*=\s*"([^"]+)"').Matches[0].Groups[1].Value
Write-Output "TAG_VERSION=$version" >> $env:GITHUB_ENV
- name: Get Current Date
run: |
$currentDate = Get-Date -UFormat "%Y%m%d"
Write-Output "BUILD_DATE=$currentDate" >> $env:GITHUB_ENV
- name: Create Release
if: always() && env.TAG_VERSION != ''
uses: softprops/action-gh-release@v2
with:
files: dist/**/*

Copilot uses AI. Check for mistakes.
Comment on lines +106 to +112
- name: Create Git Tag
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag "v${{ env.TAG_VERSION }}-cpu-${{ env.AVXVER }}-linux-${{ env.BUILD_DATE }}"
git push origin "v${{ env.TAG_VERSION }}-cpu-${{ env.AVXVER }}-linux-${{ env.BUILD_DATE }}"

Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The Create Git Tag step will conflict with the job matrix: every Python-version run will attempt to create/push the same tag (v<TAG_VERSION>-cpu-<AVXVER>-linux-<BUILD_DATE>). This will cause the later matrix jobs to fail, and re-running the workflow on the same day/version will also fail if the tag already exists. Consider removing the explicit git tag/git push and relying on softprops/action-gh-release to create/update the tag, or gate tag/release creation to a single matrix entry and publish all wheels from a dedicated release job that downloads artifacts from the build matrix.

Suggested change
- name: Create Git Tag
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag "v${{ env.TAG_VERSION }}-cpu-${{ env.AVXVER }}-linux-${{ env.BUILD_DATE }}"
git push origin "v${{ env.TAG_VERSION }}-cpu-${{ env.AVXVER }}-linux-${{ env.BUILD_DATE }}"

Copilot uses AI. Check for mistakes.
@JamePeng
Copy link
Copy Markdown
Owner

JamePeng commented Apr 15, 2026

Hi, Thank you very much for your submission.
But I don't think it's really necessary to compile a CPU-only version of Wheel, because you also need to consider ARM and other CPU architectures. You can simply clone the latest code using git clone, enable -DGGML_NATIVE=ON, and then install it using pip install . depending on your local environment. The CPU-only compilation itself only takes a few minutes. CPU-only versions compiled with the local compiler will have better compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants