-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55e4003
commit abe6aed
Showing
1 changed file
with
82 additions
and
0 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,82 @@ | ||
name: Python CI/CD | ||
|
||
on: | ||
push: | ||
branches: [ '**' ] | ||
tags-ignore: [ '**' ] | ||
pull_request: | ||
workflow_dispatch: | ||
release: | ||
types: | ||
- published | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
# Execute a "weekly" build at 2 AM UTC on Thursday | ||
- cron: '0 2 * * *' | ||
|
||
jobs: | ||
|
||
build_wheels: | ||
name: Build wheels [${{ matrix.os }}] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- 3.8 | ||
os: | ||
- ubuntu-20.04 | ||
# - macos-latest | ||
# - windows-latest | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@master | ||
- run: git fetch --prune --unshallow | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install cibuildwheel | ||
run: pip install cibuildwheel | ||
|
||
- name: Build wheels | ||
run: python -m cibuildwheel --output-dir wheelhouse | ||
env: | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_BUILD: cp37-* cp38-* cp39-* | ||
CIBW_TEST_COMMAND: "python -c 'import icub_models'" | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist | ||
path: ./wheelhouse/*.whl | ||
|
||
upload_pypi: | ||
needs: | ||
- build_sdist | ||
- build_wheels | ||
runs-on: ubuntu-latest | ||
# Devel branch produces pre-releases. | ||
# Master branch produces stable releases linked to GitHub releases. | ||
|
||
steps: | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
- name: Inspect dist folder | ||
run: ls -lah dist/ | ||
|
||
- uses: pypa/gh-action-pypi-publish@master | ||
if: | | ||
github.repository == 'robotology/icub-models' && | ||
((github.event_name == 'release' && github.event.action == 'published') || | ||
(github.event_name == 'push' && github.ref == 'refs/heads/devel')) | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} |