diff --git a/.github/workflows/deploy-and-publish.yml b/.github/workflows/deploy-and-publish.yml new file mode 100644 index 0000000..cb31874 --- /dev/null +++ b/.github/workflows/deploy-and-publish.yml @@ -0,0 +1,41 @@ +name: deploy-and-publish + +on: + push: + branches: + - dev + tags: + - 'v*' + pull_request: + branches: + - dev + +jobs: + build: + name: build and deploy docs + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: 🔗 Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install wheel + - name: 💎 Install + run: | + python -m pip install --no-cache-dir -r requirements-dev.txt + - name: 💃 Build release + if: success() && startsWith(github.ref, 'refs/tags') + run: | + python setup.py clean --all sdist bdist_wheel + - name: 📦 Publish release to PyPI + if: success() && startsWith(github.ref, 'refs/tags') + run: | + twine check dist/* + twine upload dist/* --skip-existing + with: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.pypi_password }} diff --git a/src/pybullet_planning/interfaces/env_manager/simulation.py b/src/pybullet_planning/interfaces/env_manager/simulation.py index abb9e3e..ade7cd5 100644 --- a/src/pybullet_planning/interfaces/env_manager/simulation.py +++ b/src/pybullet_planning/interfaces/env_manager/simulation.py @@ -71,7 +71,7 @@ def restore(self): set_renderer(enable=self.state) -def connect(use_gui=True, shadows=True, color=None, width=None, height=None): +def connect(use_gui=True, shadows=True, color=None, width=None, height=None, mp4=None): # Shared Memory: execute the physics simulation and rendering in a separate process # https://github.com/bulletphysics/bullet3/blob/master/examples/pybullet/examples/vrminitaur.py#L7 # make sure to compile pybullet with PYBULLET_USE_NUMPY enabled @@ -85,11 +85,13 @@ def connect(use_gui=True, shadows=True, color=None, width=None, height=None): # options="--mp4=\"test.mp4\" --mp4fps=240" options = '' if color is not None: - options += '--background_color_red={} --background_color_green={} --background_color_blue={}'.format(*color) + options += ' --background_color_red={} --background_color_green={} --background_color_blue={}'.format(*color) if width is not None: - options += '--width={}'.format(width) + options += ' --width={}'.format(width) if height is not None: - options += '--height={}'.format(height) + options += ' --height={}'.format(height) + if mp4 is not None: + options += ' --mp4={}'.format(mp4) sim_id = p.connect(method, options=options) # key=None, #sim_id = p.connect(p.GUI, options="--opengl2") if use_gui else p.connect(p.DIRECT) assert 0 <= sim_id