Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy to PyPI #23

Merged
merged 4 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 35 additions & 7 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ jobs:

steps:

- uses: actions/checkout@master
- run: git fetch --prune --unshallow
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8

Expand All @@ -32,14 +33,14 @@ jobs:
- name: Inspect dist folder
run: ls -lah dist/

- name: Check wheel's abi and platform tag
- name: Check wheel's abi and platform tags
run: test $(find dist/ -name *-none-any.whl | wc -l) -gt 0

- name: Run twine check
run: twine check dist/*

- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: dist/*
name: dist
Expand All @@ -65,12 +66,12 @@ jobs:
steps:

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Download Python packages
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
path: dist
name: dist
Expand All @@ -81,3 +82,30 @@ jobs:

- name: Import the package
run: python -c "import jaxsim"

publish:
name: Publish to PyPI
needs: test
runs-on: ubuntu-22.04

steps:

- name: Download Python packages
uses: actions/download-artifact@v3
with:
path: dist
name: dist

- name: Inspect dist folder
run: ls -lah dist/

- name: Publish to PyPI
if: |
github.repository == 'ami-iit/jaxsim' &&
((github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'release'))
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ Planned features:
You can install the project with [`pypa/pip`][pip], preferably in a [virtual environment][venv]:

```bash
pip install "jaxsim @ git+https://github.com/ami-iit/jaxsim"
pip install jaxsim
```

Have a look to [`setup.cfg`](setup.cfg) for a complete list of optional dependencies.
You can install all of them specifying `jaxsim[all]`.
You can install all of them by specifying `jaxsim[all]`.

**Note:** if you need GPU support, please follow the official [installation instruction][jax_gpu] of JAX.

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ install_requires =
jaxlie
jax_dataclasses >= 1.2.2, < 1.4.0
pptree
rod @ git+https://github.com/ami-iit/rod
rod
scipy

[options.packages.find]
Expand Down