Skip to content

Test for publishing wheel to testpypi #10

Test for publishing wheel to testpypi

Test for publishing wheel to testpypi #10

Workflow file for this run

name: Build and Publish Wheels to PyPI
on:
push:
# 1. Trigger the workflow on a specific branch for testing (recommended)
# Change 'test-pypi-publish' to the branch you are using.
branches:
- 'vllm/ernie_build_wheel'
# 2. Uncomment the 'tags' section when you are ready to publish final versions to PyPI
# tags:
# - 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
matrix:
# Define the operating systems for which to build wheels
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
# Install cibuildwheel
- name: Install cibuildwheel
run: pip install cibuildwheel
# Build the wheels for all Python versions supported by the OS
- name: Build wheels
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
# This tells cibuildwheel to only build for CPython 3.12 ('cp312')
CIBW_BUILD: "cp312-*"
# --output-dir specifies where cibuildwheel saves the wheels
run: cibuildwheel --output-dir wheelhouse
# Upload the built wheels as an artifact so the 'publish' job can access them
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
publish:
name: Publish to Test PyPI
runs-on: ubuntu-latest
# This job only runs after all build_wheels jobs are successful
needs: [build_wheels]
steps:
- uses: actions/checkout@v4
# Download all the wheels (artifacts) generated by the build_wheels jobs
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist # Download all wheels into the 'dist' folder
# Securely upload all files in 'dist' to the PyPI repository
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
# Use the secret token you created for Test PyPI (see instructions)
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
user: __token__
packages_dir: dist/wheels-ubuntu-latest/
# Publish to Test PyPI for safety during testing
repository_url: https://test.pypi.org/legacy/