diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 354892335..a26b0ed23 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/README.md b/README.md index ed012cb8a..91a726390 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/setup.cfg b/setup.cfg index 48055a12a..b23f5c3e4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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]