-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish pre-built wheels to PyPI (#27)
- Loading branch information
1 parent
0d9f7a1
commit 9f75476
Showing
4 changed files
with
69 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: build-wheels | ||
|
||
on: | ||
push: | ||
branches: | ||
- wheel | ||
tags: | ||
- '*' | ||
|
||
concurrency: | ||
group: build-wheels-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# see https://cibuildwheel.readthedocs.io/en/stable/changelog/ | ||
# for a list of versions | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_SKIP: "cp27-* cp35-* *-win32 pp* *-musllinux*" | ||
CIBW_BUILD_VERBOSITY: 3 | ||
|
||
- name: Display wheels | ||
shell: bash | ||
run: | | ||
ls -lh ./wheelhouse/ | ||
ls -lh ./wheelhouse/*.whl | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
- name: Publish wheels to PyPI | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
shell: bash | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install wheel twine setuptools | ||
twine upload ./wheelhouse/*.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,36 @@ | ||
# Copyright (c) 2020 Xiaomi Corporation (author: Fangjun Kuang) | ||
|
||
function(download_pybind11) | ||
if(CMAKE_VERSION VERSION_LESS 3.11) | ||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) | ||
endif() | ||
|
||
include(FetchContent) | ||
|
||
set(pybind11_URL "https://github.com/pybind/pybind11/archive/v2.6.0.tar.gz") | ||
set(pybind11_HASH "SHA256=90b705137b69ee3b5fc655eaca66d0dc9862ea1759226f7ccd3098425ae69571") | ||
set(pybind11_URL "https://github.com/pybind/pybind11/archive/refs/tags/v2.10.2.tar.gz") | ||
set(pybind11_HASH "SHA256=93bd1e625e43e03028a3ea7389bba5d3f9f2596abc074b068e70f4ef9b1314ae") | ||
|
||
# If you don't have access to the Internet, please download it to your | ||
# local drive and modify the following line according to your needs. | ||
if(EXISTS "/star-fj/fangjun/download/github/pybind11-2.10.2.tar.gz") | ||
set(pybind11_URL "file:///star-fj/fangjun/download/github/pybind11-2.10.2.tar.gz") | ||
elseif(EXISTS "/Users/fangjun/Downloads/pybind11-2.10.2.tar.gz") | ||
set(pybind11_URL "file:///Users/fangjun/Downloads/pybind11-2.10.2.tar.gz") | ||
elseif(EXISTS "/tmp/pybind11-2.10.2.tar.gz") | ||
set(pybind11_URL "file:///tmp/pybind11-2.10.2.tar.gz") | ||
endif() | ||
|
||
set(double_quotes "\"") | ||
set(dollar "\$") | ||
set(semicolon "\;") | ||
FetchContent_Declare(pybind11 | ||
URL ${pybind11_URL} | ||
URL_HASH ${pybind11_HASH} | ||
PATCH_COMMAND | ||
) | ||
|
||
FetchContent_GetProperties(pybind11) | ||
if(NOT pybind11_POPULATED) | ||
message(STATUS "Downloading pybind11") | ||
message(STATUS "Downloading pybind11 from ${pybind11_URL}") | ||
FetchContent_Populate(pybind11) | ||
endif() | ||
message(STATUS "pybind11 is downloaded to ${pybind11_SOURCE_DIR}") | ||
add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR} EXCLUDE_FROM_ALL) | ||
endfunction() | ||
|
||
download_pybind11() | ||
|