mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-04-20 06:48:53 +00:00
Initial wheel build and publishing infrastructure
This commit is contained in:
58
.github/workflows/build-wheels.yml
vendored
Normal file
58
.github/workflows/build-wheels.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: Build Python Wheels
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash --noprofile --norc -euo pipefail {0}
|
||||
|
||||
jobs:
|
||||
build-wheels:
|
||||
name: Build wheel (CUDA ${{ matrix.cuda }}, Python ${{ matrix.python }})
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
cuda: ['12', '13']
|
||||
python: ['3.10', '3.11', '3.12', '3.13']
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build wheel
|
||||
run: |
|
||||
bash ci/build_pynvbench_wheel.sh -py-version ${{ matrix.python }} -cuda-version ${{ matrix.cuda }}
|
||||
|
||||
- name: Upload wheel artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wheel-pynvbench-cu${{ matrix.cuda }}-py${{ matrix.python }}
|
||||
path: wheelhouse/*.whl
|
||||
retention-days: 7
|
||||
if-no-files-found: error
|
||||
|
||||
verify-wheels:
|
||||
name: Verify all wheels built successfully
|
||||
if: ${{ always() }}
|
||||
needs: build-wheels
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check build results
|
||||
run: |
|
||||
if [[ "${{ needs.build-wheels.result }}" != "success" ]]; then
|
||||
echo "Wheel builds failed!"
|
||||
exit 1
|
||||
fi
|
||||
echo "All wheels built successfully!"
|
||||
|
||||
53
.github/workflows/publish-wheels.yml
vendored
Normal file
53
.github/workflows/publish-wheels.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
name: Publish Wheels to PyPI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
run-id:
|
||||
description: "The GitHub Actions run ID that generated validated artifacts"
|
||||
required: true
|
||||
type: string
|
||||
wheel-dst:
|
||||
description: "Which wheel index to publish to?"
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- testpypi
|
||||
- pypi
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash --noprofile --norc -xeuo pipefail {0}
|
||||
|
||||
jobs:
|
||||
publish-wheels:
|
||||
name: Publish wheels to ${{ inputs.wheel-dst }}
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: ${{ inputs.wheel-dst }}
|
||||
url: https://${{ (inputs.wheel-dst == 'testpypi' && 'test.') || '' }}pypi.org/p/pynvbench/
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Download all wheel artifacts
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
RUN_ID: ${{ inputs.run-id }}
|
||||
run: |
|
||||
gh run download ${RUN_ID} -D dl -R ${{ github.repository }} -p 'wheel-*'
|
||||
mkdir -p dist
|
||||
find dl -name '*.whl' -exec mv {} dist/ \;
|
||||
rm -rf dl
|
||||
ls -lh dist/
|
||||
|
||||
- name: Publish package distributions to PyPI
|
||||
if: ${{ inputs.wheel-dst == 'pypi' }}
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
|
||||
- name: Publish package distributions to TestPyPI
|
||||
if: ${{ inputs.wheel-dst == 'testpypi' }}
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
repository-url: https://test.pypi.org/legacy/
|
||||
|
||||
Reference in New Issue
Block a user