-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* - draft wheel for macOS * - added wheel testing * - add platform tag to wheel * - publish macOS wheel to PyPI & GHR
- Loading branch information
1 parent
df023f5
commit 25bf422
Showing
5 changed files
with
274 additions
and
7 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
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,131 @@ | ||
name: Build macOS wheels | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_wheel: | ||
name: Build wheel on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-10.15] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install packages | ||
run: brew install coreutils | ||
|
||
- name: Build wheel | ||
run: sudo ./scripts/build-wheels-macOS.sh | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./dist/mrob*.whl | ||
|
||
test_wheel: | ||
name: Test Python ${{ matrix.python }} wheel on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
needs: build_wheel | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-10.15] | ||
python: [3.5, 3.9] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: Install mrob & numpy | ||
run: | | ||
python3 -m pip install ./artifact/mrob*.whl numpy | ||
- name: Run FGraph_2d | ||
run: | | ||
python3 mrobpy/tests/FGraph_2d.py | ||
- name: Run FGraph_M3500 | ||
run: | | ||
python3 mrobpy/tests/FGraph_M3500.py | ||
- name: Run FGraph_sphere | ||
run: | | ||
python3 mrobpy/tests/FGraph_sphere.py | ||
- name: Run SE3_examples | ||
run: | | ||
python3 mrobpy/tests/SE3_examples.py | ||
- name: Run FGraph_landmark_3d_example | ||
run: | | ||
python3 mrobpy/tests/FGraph_landmark_3d_example.py | ||
- name: Run FGraph_landmark_2d_example | ||
run: | | ||
python3 mrobpy/tests/FGraph_landmark_2d_example.py | ||
- name: Run PC_align | ||
run: | | ||
python3 mrobpy/tests/PC_align.py | ||
publish_pypi: | ||
name: Publish macOS wheel to PyPI | ||
needs: test_wheel | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
packages_dir: artifact/ | ||
|
||
publish-github-release: | ||
name: Publish macOS wheel to GitHub Releases | ||
needs: test_wheel | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: Create Draft Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Export release assets | ||
id: path | ||
run: | | ||
whl=$(find artifact/ -name '*.whl' -exec basename {} \;) | ||
echo "::set-output name=WHL::$whl" | ||
- uses: actions/upload-release-asset@v1.0.1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: artifact/${{ steps.path.outputs.WHL }} | ||
asset_name: ${{ steps.path.outputs.WHL }} | ||
asset_content_type: application/octet-stream | ||
|
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,52 @@ | ||
# Copyright (c) 2018, Skolkovo Institute of Science and Technology (Skoltech) | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# | ||
# build-wheels.sh | ||
# | ||
# Created on: Mar 22, 2021 | ||
# Author: Lyubov Miloserdova | ||
# miloslubov@gmail.com | ||
# | ||
|
||
#!/bin/bash | ||
set -euo pipefail | ||
export LC_ALL=C | ||
export MACOSX_DEPLOYMENT_TARGET=10.9 | ||
|
||
cd $(dirname $(greadlink -f "${BASH_SOURCE[0]}"))/.. | ||
mkdir -p ./build ./dist ./mrob | ||
|
||
cp ./__init__.py ./mrob/__init__.py | ||
|
||
cd ./build | ||
|
||
NUMPROC=$(sysctl -n hw.ncpu) | ||
echo "Running $NUMPROC parallel jobs" | ||
|
||
for PYBIN in /Users/runner/hostedtoolcache/Python/3.*/x64/bin/python3.[5-9] | ||
do | ||
cmake .. -DPYTHON_EXECUTABLE:FILEPATH=$PYBIN \ | ||
-DCMAKE_MACOSX_RPATH=ON \ | ||
-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE \ | ||
-DCMAKE_INSTALL_RPATH="@loader_path" | ||
make -j $NUMPROC | ||
|
||
mv ../lib/* ../mrob | ||
done | ||
|
||
cd ../ | ||
python3 -m pip install --user -q build | ||
python3 -m build --wheel --outdir dist/ . | ||
|
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 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