Skip to content

Commit

Permalink
Add wheel CI for PR and update release (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaogaotiantian authored Oct 5, 2023
1 parent 5b142c9 commit 3ecd46a
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 35 deletions.
79 changes: 46 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,28 @@ on:
types: [created]

jobs:
deploy-wheels:
name: Deploy wheels on ${{ matrix.os }} for ${{ matrix.arch }}
deploy-wheels-linux:
name: Deploy wheels on Linux for ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
python-version: [38, 39, 310, 311, 312]
manylinux-image: [manylinux2014, manylinux_2_24]
arch: [auto]
include:
- os: ubuntu-latest
manylinux-image: manylinux2014
arch: aarch64
python-version: 38
- os: ubuntu-latest
manylinux-image: manylinux2014
arch: aarch64
python-version: 39
- os: ubuntu-latest
manylinux-image: manylinux2014
arch: aarch64
python-version: 310
- os: ubuntu-latest
manylinux-image: manylinux2014
arch: aarch64
python-version: 311
- os: ubuntu-latest
manylinux-image: manylinux2014
arch: aarch64
python-version: 312
exclude:
# manyliunx image is not a valid variation on MacOS and Windows
- os: macos-latest
manylinux-image: manylinux2014
- os: windows-latest
manylinux-image: manylinux2014
manylinux-image: [manylinux2014]
arch: [auto, aarch64]

steps:
- uses: actions/checkout@v3

- name: Set up QEMU
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v1

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -64,10 +40,47 @@ jobs:
env:
CIBW_BUILD: 'cp${{ matrix.python-version }}-*'
CIBW_SKIP: '*musllinux*'
CIBW_ARCHS: ${{matrix.arch}}
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_MANYLINUX_*_IMAGE: ${{ matrix.manylinux-image }}
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux-image }}

- name: Publish wheels to PyPI Unix
continue-on-error: true
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload wheelhouse/*.whl
deploy-wheels-macos-windows:
name: Deploy wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: [38, 39, 310, 311, 312]

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine flake8 setuptools wheel
- name: Install cibuildwheel
run: python -m pip install cibuildwheel -U

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: 'cp${{ matrix.python-version }}-*'

- name: Publish wheels to PyPI Unix
if: matrix.os != 'windows-latest'
continue-on-error: true
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: wheels

on:
push:
branches: [ master ]
pull_request:

jobs:
build-wheels-linux:
name: Build wheels on Linux for ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [38, 39, 310, 311, 312]
manylinux-image: [manylinux2014]
arch: [auto, aarch64]

steps:
- uses: actions/checkout@v3
- name: Set up QEMU
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine flake8 setuptools wheel
- name: Install cibuildwheel
run: python -m pip install cibuildwheel -U

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: 'cp${{ matrix.python-version }}-*'
CIBW_SKIP: '*musllinux*'
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_MANYLINUX_*_IMAGE: ${{ matrix.manylinux-image }}
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux-image }}

build-wheels-macos-windows:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: [38, 39, 310, 311, 312]

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine flake8 setuptools wheel
- name: Install cibuildwheel
run: python -m pip install cibuildwheel -U

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: 'cp${{ matrix.python-version }}-*'
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ include setup.py
recursive-include src/viztracer/html *.css *.js
recursive-include src/viztracer/modules *.c *.h
recursive-include src/viztracer/web_dist *
recursive-include src/viztracer/attach_process *
recursive-include src/viztracer/attach_process *.py
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@
],
}

if sys.platform == "win32":
package_data["viztracer"].extend([
"attach_process/attach_x86.dll",
"attach_process/attach_x86_64.dll",
"attach_process/inject_dll.exe",
"attach_process/inject_dll_amd64.exe",
"attach_process/run_code_on_dllmain_amd64.dll",
"attach_process/run_code_on_dllmain_x86.dll",
])
if sys.platform == "darwin":
package_data["viztracer"].extend([
"attach_process/attach_x86_64.dylib",
"attach_process/linux_and_mac/lldb_prepare.py",
])
elif sys.platform in ("linux", "linux2"):
if platform.machine() == "i686":
Expand Down
Binary file modified src/viztracer/attach_process/attach_linux_amd64.so
Binary file not shown.

0 comments on commit 3ecd46a

Please sign in to comment.