Skip to content

Commit

Permalink
Merge pull request #23 from ami-iit/feature/pypi
Browse files Browse the repository at this point in the history
Deploy to PyPI
  • Loading branch information
diegoferigo committed Nov 11, 2022
2 parents 2df65f7 + a503f18 commit 2f25fc3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
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

0 comments on commit 2f25fc3

Please sign in to comment.