Fuck git
This commit is contained in:
174
external/capstone/.github/workflows/build-wheels-publish.yml
vendored
Normal file
174
external/capstone/.github/workflows/build-wheels-publish.yml
vendored
Normal file
@@ -0,0 +1,174 @@
|
||||
# SPDX-FileCopyrightText: 2024 Antelox <anteloxrce@gmail.com>
|
||||
# SPDX-License-Identifier: BSD-3
|
||||
|
||||
name: Build and publish wheels with cibuildwheel
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
debugMode:
|
||||
description: 'Debug Mode'
|
||||
required: false
|
||||
default: ''
|
||||
type: choice
|
||||
options:
|
||||
- '0'
|
||||
- '1'
|
||||
|
||||
push:
|
||||
paths-ignore:
|
||||
- ".gitignore"
|
||||
- "CREDITS.TXT"
|
||||
- "ChangeLog"
|
||||
- "README.md"
|
||||
- "docs/**"
|
||||
pull_request:
|
||||
|
||||
# Automatically cancel any previous running workflow on new push
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
# Enable DEBUG flag either according to the tag release or manual override
|
||||
CAPSTONE_DEBUG: ${{ inputs.debugMode != '' && inputs.debugMode || startsWith(github.ref, 'refs/tags') && '0' || '1' }}
|
||||
|
||||
jobs:
|
||||
build_and_test_wheels:
|
||||
name: Building on ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.cibw_build }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# NOTE: Making this to parallelize and speed up workflow
|
||||
# i686 - manylinux
|
||||
# - { os: ubuntu-latest, arch: i686, cibw_build: 'cp*-manylinux*', cibw_skip: '*36* *37*' }
|
||||
# i686 - musllinux
|
||||
# - { os: ubuntu-latest, arch: i686, cibw_build: 'cp*-musllinux*', cibw_skip: '*36* *37*' }
|
||||
# x86_64 - manylinux
|
||||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp*-manylinux*', cibw_skip: '*36* *37*' }
|
||||
# x86_64 - musllinux
|
||||
- { os: ubuntu-latest, arch: x86_64, cibw_build: 'cp*-musllinux*', cibw_skip: '*36* *37*' }
|
||||
# aarch64 - manylinux
|
||||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp*-manylinux*', cibw_skip: '*36* *37*' }
|
||||
# aarch64 - musllinux
|
||||
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_build: 'cp*-musllinux*', cibw_skip: '*36* *37*' }
|
||||
# macos - x86_64
|
||||
- { os: macos-13, arch: x86_64, cibw_build: 'cp*', cibw_skip: '*36* *37*' }
|
||||
# macos - arm64
|
||||
- { os: macos-latest, arch: arm64, cibw_build: 'cp*', cibw_skip: '*36* *37*' }
|
||||
# windows - amd64
|
||||
- { os: windows-latest, arch: AMD64, cibw_build: 'cp*', cibw_skip: '*36* *37*' }
|
||||
# windows - x86
|
||||
# - { os: windows-latest, arch: x86, cibw_build: 'cp*', cibw_skip: '*36* *37*' }
|
||||
# windows - arm64
|
||||
- { os: windows-latest, arch: ARM64, cibw_build: 'cp*', cibw_skip: '*36* *37* *38*' }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# https://github.com/actions/upload-artifact/issues/22
|
||||
- name: Prepare a unique name for Artifacts
|
||||
shell: bash
|
||||
run: |
|
||||
# replace not-allowed chars with dash
|
||||
name="cibw-wheels-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cibw_build }}"
|
||||
name=$(echo -n "$name" | sed -e 's/[ \t:\/\\"<>|*?]/-/g' -e 's/--*/-/g' | sed -e 's/\-$//')
|
||||
echo "ARTIFACT_NAME=$name" >> $GITHUB_ENV
|
||||
|
||||
# https://cibuildwheel.pypa.io/en/stable/faq/#macos-building-cpython-38-wheels-on-arm64
|
||||
- uses: actions/setup-python@v5
|
||||
if: runner.os == 'macOS' && runner.arch == 'ARM64'
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
- name: '🛠️ Win MSVC 32 dev cmd setup'
|
||||
if: runner.os == 'Windows' && matrix.arch == 'x86'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: x86
|
||||
|
||||
- name: '🛠️ Win MSVC 64 dev cmd setup'
|
||||
if: runner.os == 'Windows' && matrix.arch == 'AMD64'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: '🛠️ Win MSVC ARM64 dev cmd setup'
|
||||
if: runner.os == 'Windows' && matrix.arch == 'ARM64'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: amd64_arm64
|
||||
|
||||
- name: '🛠️ Set up QEMU'
|
||||
if: runner.os == 'Linux' && matrix.arch == 'i686'
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: '🚧 cibuildwheel run'
|
||||
uses: pypa/cibuildwheel@v2.23.3
|
||||
env:
|
||||
CIBW_BUILD_FRONTEND: build
|
||||
CIBW_BUILD: ${{ matrix.cibw_build }}
|
||||
CIBW_SKIP: ${{ matrix.cibw_skip }}
|
||||
CIBW_ARCHS: ${{ matrix.arch }}
|
||||
CIBW_ENVIRONMENT: DEBUG=${{ env.CAPSTONE_DEBUG }}
|
||||
CIBW_ENVIRONMENT_PASS_LINUX: DEBUG
|
||||
# https://cibuildwheel.pypa.io/en/stable/faq/#windows-arm64
|
||||
# https://github.com/pypa/cibuildwheel/pull/1169
|
||||
CIBW_TEST_SKIP: "*-win_arm64 cp38-macosx_*:arm64"
|
||||
CIBW_TEST_COMMAND: >
|
||||
python -m pip install {package}/cstest_py &&
|
||||
python {project}/suite/run_tests.py
|
||||
with:
|
||||
package-dir: bindings/python
|
||||
output-dir: wheelhouse
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.ARTIFACT_NAME }}
|
||||
path: ./wheelhouse/*.whl
|
||||
|
||||
make_sdist:
|
||||
name: Make SDist
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
|
||||
- name: Build SDist
|
||||
run: |
|
||||
python3 -m pip install -U pip build
|
||||
python3 -m build --sdist bindings/python
|
||||
python3 -m pip install bindings/python/dist/*.tar.gz
|
||||
python3 -c 'import capstone; print(f"Capstone version installed from sdist: {capstone.__version__}")'
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: sdist-archive
|
||||
path: bindings/python/dist/*.tar.gz
|
||||
|
||||
publish:
|
||||
needs: [ build_and_test_wheels, make_sdist ]
|
||||
environment: pypi
|
||||
permissions:
|
||||
id-token: write
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags')
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
merge-multiple: true
|
||||
path: dist
|
||||
|
||||
- name: Show downloaded artifacts
|
||||
run: ls -laR dist
|
||||
|
||||
- name: '📦 Publish distribution to PyPI'
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
if: ${{ success() }}
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.pypi_pass }}
|
||||
Reference in New Issue
Block a user