diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93a84925..6cab971e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 00000000..bcb471df --- /dev/null +++ b/.github/workflows/wheels.yml @@ -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 }}-*' diff --git a/MANIFEST.in b/MANIFEST.in index a8d58476..53526611 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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 diff --git a/setup.py b/setup.py index 0919f78d..9b118dee 100644 --- a/setup.py +++ b/setup.py @@ -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": diff --git a/src/viztracer/attach_process/attach_linux_amd64.so b/src/viztracer/attach_process/attach_linux_amd64.so index 2aa79932..30464f23 100755 Binary files a/src/viztracer/attach_process/attach_linux_amd64.so and b/src/viztracer/attach_process/attach_linux_amd64.so differ